lib/httpx/errors.rb in httpx-0.0.3 vs lib/httpx/errors.rb in httpx-0.0.4
- old
+ new
@@ -4,13 +4,17 @@
Error = Class.new(StandardError)
TimeoutError = Class.new(Error)
HTTPError = Class.new(Error) do
- attr_reader :status
+ attr_reader :response
- def initialize(status)
- @status = status
- super("HTTP Error: #{status}")
+ def initialize(response)
+ @response = response
+ super("HTTP Error: #{@response.status}")
+ end
+
+ def status
+ @response.status
end
end
end