lib/triviacrack/errors/request_error.rb in triviacrack-0.2.0 vs lib/triviacrack/errors/request_error.rb in triviacrack-0.3.0

- old
+ new

@@ -5,14 +5,23 @@ class RequestError < StandardError # Public: The HTTP status code returned by the Trivia Crack server. attr_reader :code + #Public: The URL that was requested. + attr_reader :url + + #Public: The response body that was returned by the Trivia Crack server. + attr_reader :body + # Public: Initializes a RequestError. # # code - The HTTP status code returned by the Trivia Crack server. - def initialize(code) + # url - The URL that was requested. + # body - The response body that was returned by the Trivia Crack server. + def initialize(code, url, body) @code = code + @url = url end end end end