Skip to content

Commit

Permalink
Fix error formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ksylvest committed Jul 19, 2024
1 parent 6403c4a commit 7dfc3cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
omniai (1.6.2)
omniai (1.6.3)
event_stream_parser
http
zeitwerk
Expand Down
8 changes: 7 additions & 1 deletion lib/omniai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@ class Error < StandardError; end

# An error that wraps an HTTP::Response for non-OK requests.
class HTTPError < Error
# @return [HTTP::Response]
attr_accessor :response

# @param response [HTTP::Response]
def initialize(response)
super("status=#{response.status.inspect} headers=#{response.headers.inspect} body=#{response.body}")
super("status=#{response.status} body=#{response.body}")

@response = response
end

def inspect
"#<#{self.class} status=#{@response.status} body=#{@response.body}>"
end
end
end
2 changes: 1 addition & 1 deletion lib/omniai/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module OmniAI
VERSION = '1.6.2'
VERSION = '1.6.3'
end

0 comments on commit 7dfc3cd

Please sign in to comment.