Exception: Supabase::Storage::Errors::StorageApiError
- Inherits:
-
StorageError
- Object
- StandardError
- StorageError
- Supabase::Storage::Errors::StorageApiError
- Defined in:
- lib/supabase/storage/errors.rb
Overview
Raised when the Storage REST API returns a non-2xx response. Mirrors supabase-py’s StorageApiError contract — exposes :message, :code (the API’s ‘error` field, e.g. “InvalidKey”), and :status (HTTP status).
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message, code: nil, status: nil) ⇒ StorageApiError
constructor
A new instance of StorageApiError.
- #to_h ⇒ Object
Constructor Details
#initialize(message, code: nil, status: nil) ⇒ StorageApiError
Returns a new instance of StorageApiError.
15 16 17 18 19 |
# File 'lib/supabase/storage/errors.rb', line 15 def initialize(, code: nil, status: nil) @code = code @status = status super(.to_s) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
13 14 15 |
# File 'lib/supabase/storage/errors.rb', line 13 def code @code end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
13 14 15 |
# File 'lib/supabase/storage/errors.rb', line 13 def status @status end |
Instance Method Details
#to_h ⇒ Object
21 22 23 |
# File 'lib/supabase/storage/errors.rb', line 21 def to_h { "name" => "StorageApiError", "message" => , "code" => @code, "status" => @status } end |