Exception: ChatWork::AuthenticateError
- Inherits:
-
ChatWorkError
- Object
- StandardError
- ChatWorkError
- ChatWork::AuthenticateError
- Defined in:
- lib/chatwork/chatwork_error.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#error_description ⇒ Object
readonly
Returns the value of attribute error_description.
Attributes inherited from ChatWorkError
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, status, error_response, error, error_description) ⇒ AuthenticateError
constructor
A new instance of AuthenticateError.
Methods inherited from ChatWorkError
Constructor Details
#initialize(message, status, error_response, error, error_description) ⇒ AuthenticateError
Returns a new instance of AuthenticateError.
64 65 66 67 68 69 |
# File 'lib/chatwork/chatwork_error.rb', line 64 def initialize(, status, error_response, error, error_description) @error = error @error_description = error_description super(, status, error_response) end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
62 63 64 |
# File 'lib/chatwork/chatwork_error.rb', line 62 def error @error end |
#error_description ⇒ Object (readonly)
Returns the value of attribute error_description.
62 63 64 |
# File 'lib/chatwork/chatwork_error.rb', line 62 def error_description @error_description end |
Class Method Details
.from_www_authenticate(www_authenticate:, status:, error_response:) ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/chatwork/chatwork_error.rb', line 71 def self.from_www_authenticate(www_authenticate:, status:, error_response:) www_authenticate =~ /error="([^\"]+)"/ error = Regexp.last_match(1) www_authenticate =~ /error_description="([^\"]+)"/ error_description = Regexp.last_match(1) AuthenticateError.new( www_authenticate, status, error_response, error, error_description, ) end |