Exception: SongstatsSDK::SongstatsAPIError
- Inherits:
-
SongstatsError
- Object
- StandardError
- SongstatsError
- SongstatsSDK::SongstatsAPIError
- Defined in:
- lib/songstats_sdk/errors.rb
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(message:, status_code:, payload: nil) ⇒ SongstatsAPIError
constructor
A new instance of SongstatsAPIError.
- #to_s ⇒ Object
Constructor Details
#initialize(message:, status_code:, payload: nil) ⇒ SongstatsAPIError
Returns a new instance of SongstatsAPIError.
11 12 13 14 15 16 |
# File 'lib/songstats_sdk/errors.rb', line 11 def initialize(message:, status_code:, payload: nil) @error_message = super(@error_message) @status_code = status_code @payload = payload end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
9 10 11 |
# File 'lib/songstats_sdk/errors.rb', line 9 def payload @payload end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
9 10 11 |
# File 'lib/songstats_sdk/errors.rb', line 9 def status_code @status_code end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/songstats_sdk/errors.rb', line 18 def to_s "Songstats API error (#{status_code}): #{@error_message}" end |