Exception: Safire::Errors::RegistrationError

Inherits:
OAuthError show all
Includes:
ReceivesFields
Defined in:
lib/safire/errors.rb

Overview

Raised when Dynamic Client Registration (RFC 7591) fails.

Two usage paths:

  • HTTP failure: provide status, error_code, and/or error_description

  • Structural failure (missing client_id in a 2xx response): provide received_fields

Instance Attribute Summary collapse

Attributes inherited from OAuthError

#error_code, #error_description, #status

Method Summary

Methods included from ReceivesFields

included, #initialize

Methods inherited from OAuthError

#initialize

Instance Attribute Details

#received_fieldsArray<String>? (readonly)

Returns field names present in a response missing client_id (no values logged).

Returns:

  • (Array<String>, nil)

    field names present in a response missing client_id (no values logged)



209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/safire/errors.rb', line 209

class RegistrationError < OAuthError
  include ReceivesFields

  private

  def operation_label = 'Client registration failed'

  def build_message
    return super unless @received_fields&.any?

    "Registration response missing client_id; received fields: #{@received_fields.join(', ')}"
  end
end