From 7dfc3cd1b41758697c5fcec43b4a7e172d68ad72 Mon Sep 17 00:00:00 2001 From: Kevin Sylvestre Date: Thu, 18 Jul 2024 21:02:51 -0700 Subject: [PATCH] Fix error formatting --- Gemfile.lock | 2 +- lib/omniai.rb | 8 +++++++- lib/omniai/version.rb | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4089928..b17a984 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - omniai (1.6.2) + omniai (1.6.3) event_stream_parser http zeitwerk diff --git a/lib/omniai.rb b/lib/omniai.rb index 5b8f6a9..d81d488 100644 --- a/lib/omniai.rb +++ b/lib/omniai.rb @@ -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 diff --git a/lib/omniai/version.rb b/lib/omniai/version.rb index 7c939f5..5f026d1 100644 --- a/lib/omniai/version.rb +++ b/lib/omniai/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module OmniAI - VERSION = '1.6.2' + VERSION = '1.6.3' end