Exception: Supabase::Rails::AuthError

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

Constant Summary collapse

AUTH_GENERIC_ERROR =
"AUTH_ERROR"
INVALID_CREDENTIALS =
"INVALID_CREDENTIALS"
CREATE_SUPABASE_CLIENT_ERROR =
"CREATE_SUPABASE_CLIENT_ERROR"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, code = AUTH_GENERIC_ERROR, status = 401) ⇒ AuthError

Returns a new instance of AuthError.



61
62
63
64
65
# File 'lib/supabase/rails/errors.rb', line 61

def initialize(message, code = AUTH_GENERIC_ERROR, status = 401)
  super(message)
  @code = code
  @status = status
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



59
60
61
# File 'lib/supabase/rails/errors.rb', line 59

def code
  @code
end

#statusObject (readonly)

Returns the value of attribute status.



59
60
61
# File 'lib/supabase/rails/errors.rb', line 59

def status
  @status
end

Class Method Details

.create_supabase_client_errorObject



71
72
73
# File 'lib/supabase/rails/errors.rb', line 71

def self.create_supabase_client_error
  new("Failed to create Supabase client", CREATE_SUPABASE_CLIENT_ERROR, 500)
end

.invalid_credentialsObject



67
68
69
# File 'lib/supabase/rails/errors.rb', line 67

def self.invalid_credentials
  new("Invalid credentials", INVALID_CREDENTIALS, 401)
end