Module: Supabase::Postgrest::Errors

Defined in:
lib/supabase/postgrest/errors.rb

Defined Under Namespace

Classes: APIError

Class Method Summary collapse

Class Method Details

.generate_default_error_message(response) ⇒ Object

Builds a fallback error payload when the server body isn’t valid JSON.



39
40
41
42
43
44
45
46
# File 'lib/supabase/postgrest/errors.rb', line 39

def self.generate_default_error_message(response)
  {
    "message" => "JSON could not be generated",
    "code" => response.status.to_s,
    "hint" => "Refer to full message for details",
    "details" => response.body.to_s
  }
end