Exception: HumanError::Errors::DuplicateAuthenticationError

Inherits:
RuntimeError
  • Object
show all
Includes:
HumanError::Error, AuthenticationError
Defined in:
lib/human_error/errors/authentication_errors/duplicate_authentication_error.rb

Instance Attribute Summary collapse

Attributes included from HumanError::Error

#code, #developer_documentation_url, #external_documentation_url, #id, #message

Instance Method Summary collapse

Methods included from HumanError::Error

#as_json, included, #initialize, #to_json, #to_s

Instance Attribute Details

#providerObject

Returns the value of attribute provider.



9
10
11
# File 'lib/human_error/errors/authentication_errors/duplicate_authentication_error.rb', line 9

def provider
  @provider
end

#provider_user_idObject

Returns the value of attribute provider_user_id.



9
10
11
# File 'lib/human_error/errors/authentication_errors/duplicate_authentication_error.rb', line 9

def provider_user_id
  @provider_user_id
end

#user_idObject

Returns the value of attribute user_id.



9
10
11
# File 'lib/human_error/errors/authentication_errors/duplicate_authentication_error.rb', line 9

def user_id
  @user_id
end

Instance Method Details

#detailObject



21
22
23
24
25
# File 'lib/human_error/errors/authentication_errors/duplicate_authentication_error.rb', line 21

def detail
  'The authentication you attempted to register has already been registered by ' \
  'another user. We do not currently support allowing multiple users to be connected ' \
  'to the same authentication.'
end

#http_statusObject



13
14
15
# File 'lib/human_error/errors/authentication_errors/duplicate_authentication_error.rb', line 13

def http_status
  409
end

#sourceObject



27
28
29
30
31
32
33
# File 'lib/human_error/errors/authentication_errors/duplicate_authentication_error.rb', line 27

def source
  {
    'provider'         => provider,
    'provider_user_id' => provider_user_id,
    'user_id'          => user_id,
  }
end

#titleObject



17
18
19
# File 'lib/human_error/errors/authentication_errors/duplicate_authentication_error.rb', line 17

def title
  'Duplicate Authentication'
end