Exception: Audd::ApiError
Overview
The server answered with status: "error". Carries the AudD error code
plus the server's full echo of the request, which is what AudD support
asks for.
Direct Known Subclasses
AuthenticationError, BlockedError, InvalidAudioError, InvalidRequestError, NeedsUpdateError, NotReleasedError, QuotaError, RateLimitError, ServerError, StreamLimitError, SubscriptionError
Instance Attribute Summary collapse
-
#branded_message ⇒ Object
readonly
Returns the value of attribute branded_message.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#request_method ⇒ Object
readonly
Returns the value of attribute request_method.
-
#request_params ⇒ Object
readonly
Returns the value of attribute request_params.
Instance Method Summary collapse
-
#initialize(error_code:, error_message:, http_status: nil, request_id: nil, request_params: {}, request_method: nil, branded_message: nil, raw_response: nil) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(error_code:, error_message:, http_status: nil, request_id: nil, request_params: {}, request_method: nil, branded_message: nil, raw_response: nil) ⇒ ApiError
Returns a new instance of ApiError.
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/audd/errors.rb', line 42 def initialize(error_code:, error_message:, http_status: nil, request_id: nil, request_params: {}, request_method: nil, branded_message: nil, raw_response: nil) @error_code = error_code @error_message = @http_status = http_status @request_id = request_id @request_params = request_params || {} @request_method = request_method @branded_message = @raw_response = raw_response super("[##{error_code}] #{}") end |
Instance Attribute Details
#branded_message ⇒ Object (readonly)
Returns the value of attribute branded_message.
39 40 41 |
# File 'lib/audd/errors.rb', line 39 def @branded_message end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
39 40 41 |
# File 'lib/audd/errors.rb', line 39 def error_code @error_code end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
39 40 41 |
# File 'lib/audd/errors.rb', line 39 def @error_message end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
39 40 41 |
# File 'lib/audd/errors.rb', line 39 def http_status @http_status end |
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
39 40 41 |
# File 'lib/audd/errors.rb', line 39 def raw_response @raw_response end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
39 40 41 |
# File 'lib/audd/errors.rb', line 39 def request_id @request_id end |
#request_method ⇒ Object (readonly)
Returns the value of attribute request_method.
39 40 41 |
# File 'lib/audd/errors.rb', line 39 def request_method @request_method end |
#request_params ⇒ Object (readonly)
Returns the value of attribute request_params.
39 40 41 |
# File 'lib/audd/errors.rb', line 39 def request_params @request_params end |