Exception: Safire::Errors::AuthError
- Defined in:
- lib/safire/errors.rb
Overview
Raised when an authorization request fails.
Instance Attribute Summary collapse
-
#error_code ⇒ String?
readonly
OAuth2
errorfield. -
#error_description ⇒ String?
readonly
OAuth2
error_descriptionfield. -
#status ⇒ Integer?
readonly
HTTP status code.
Instance Method Summary collapse
-
#initialize(status: nil, error_code: nil, error_description: nil) ⇒ AuthError
constructor
A new instance of AuthError.
Constructor Details
#initialize(status: nil, error_code: nil, error_description: nil) ⇒ AuthError
Returns a new instance of AuthError.
154 155 156 157 158 159 |
# File 'lib/safire/errors.rb', line 154 def initialize(status: nil, error_code: nil, error_description: nil) @status = status @error_code = error_code @error_description = error_description super() end |
Instance Attribute Details
#error_code ⇒ String? (readonly)
Returns OAuth2 error field.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/safire/errors.rb', line 151 class AuthError < Error attr_reader :status, :error_code, :error_description def initialize(status: nil, error_code: nil, error_description: nil) @status = status @error_code = error_code @error_description = error_description super() end private def parts = ['Authorization request failed'] parts << "HTTP #{@status}" if @status parts << @error_code if @error_code parts << @error_description if @error_description parts.join(' — ') end end |
#error_description ⇒ String? (readonly)
Returns OAuth2 error_description field.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/safire/errors.rb', line 151 class AuthError < Error attr_reader :status, :error_code, :error_description def initialize(status: nil, error_code: nil, error_description: nil) @status = status @error_code = error_code @error_description = error_description super() end private def parts = ['Authorization request failed'] parts << "HTTP #{@status}" if @status parts << @error_code if @error_code parts << @error_description if @error_description parts.join(' — ') end end |
#status ⇒ Integer? (readonly)
Returns HTTP status code.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/safire/errors.rb', line 151 class AuthError < Error attr_reader :status, :error_code, :error_description def initialize(status: nil, error_code: nil, error_description: nil) @status = status @error_code = error_code @error_description = error_description super() end private def parts = ['Authorization request failed'] parts << "HTTP #{@status}" if @status parts << @error_code if @error_code parts << @error_description if @error_description parts.join(' — ') end end |