Exception: YourImageShare::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/yourimageshare/errors.rb

Overview

Raised for any non-2xx response or a {"type":"error"} payload - mirrors the Go/JS/Python/PHP SDKs' error shape (status + message) so error-handling logic reads the same across every official SDK. Ruby convention is to raise, not to return an error object like Go does.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, message) ⇒ APIError

Returns a new instance of APIError.



9
10
11
12
13
# File 'lib/yourimageshare/errors.rb', line 9

def initialize(status, message)
  @status = status
  @message = message
  super("yourimageshare: [#{status}] #{message}")
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



7
8
9
# File 'lib/yourimageshare/errors.rb', line 7

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/yourimageshare/errors.rb', line 7

def status
  @status
end