lib/httpx/response.rb in httpx-0.11.3 vs lib/httpx/response.rb in httpx-0.12.0
- old
+ new
@@ -266,11 +266,18 @@
def status
@error.message
end
- def to_s
- @error.backtrace.join("\n")
+ if Exception.method_defined?(:full_message)
+ def to_s
+ @error.full_message
+ end
+ else
+ def to_s
+ "#{@error.message} (#{@error.class})\n" \
+ "#{@error.backtrace.join("\n") if @error.backtrace}"
+ end
end
def raise_for_status
raise @error
end