mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-08-10 00:01:27 -04:00
adding more methods necessary for the faraday adapter when it comes to multi-response errors
This commit is contained in:
parent
cf5be6b899
commit
5823a040d0
@ -269,6 +269,14 @@ module HTTPX
|
||||
@error.message
|
||||
end
|
||||
|
||||
def reason
|
||||
@error.class.name
|
||||
end
|
||||
|
||||
def headers
|
||||
{}
|
||||
end
|
||||
|
||||
def body
|
||||
@error.backtrace.join("\n")
|
||||
end
|
||||
|
@ -18,7 +18,7 @@ class ErrorResponseTest < Minitest::Test
|
||||
|
||||
def test_respond_method_missing_errors
|
||||
r1 = ErrorResponse.new(Minitest::Mock.new, RuntimeError.new("wow"), {})
|
||||
ex1 = assert_raises(NoMethodError) { r1.headers }
|
||||
ex1 = assert_raises(NoMethodError) { r1.read }
|
||||
assert ex1.message =~ /undefined response method/
|
||||
ex2 = assert_raises(NoMethodError) { r1.bang }
|
||||
assert ex2.message =~ /undefined method/
|
||||
|
Loading…
x
Reference in New Issue
Block a user