Exception: Basecamp::Oauth::OauthError
- Inherits:
-
StandardError
- Object
- StandardError
- Basecamp::Oauth::OauthError
- Defined in:
- lib/basecamp/oauth/oauth_error.rb
Overview
OAuth-specific error class.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#hint ⇒ String?
Helpful hint for resolving the error.
-
#http_status ⇒ Integer?
HTTP status code if applicable.
-
#retryable ⇒ Boolean
Whether the request can be retried.
-
#type ⇒ String
Error type ("validation", "auth", "network", "api_error").
Instance Method Summary collapse
-
#initialize(type, message, http_status: nil, hint: nil, retryable: false) ⇒ OauthError
constructor
A new instance of OauthError.
- #to_s ⇒ Object
Constructor Details
#initialize(type, message, http_status: nil, hint: nil, retryable: false) ⇒ OauthError
Returns a new instance of OauthError.
19 20 21 22 23 24 25 |
# File 'lib/basecamp/oauth/oauth_error.rb', line 19 def initialize(type, , http_status: nil, hint: nil, retryable: false) super() @type = type @http_status = http_status @hint = hint @retryable = retryable end |
Instance Attribute Details
#hint ⇒ String?
Helpful hint for resolving the error
11 12 13 |
# File 'lib/basecamp/oauth/oauth_error.rb', line 11 def hint @hint end |
#http_status ⇒ Integer?
HTTP status code if applicable
11 12 13 |
# File 'lib/basecamp/oauth/oauth_error.rb', line 11 def http_status @http_status end |
#retryable ⇒ Boolean
Whether the request can be retried
11 12 13 |
# File 'lib/basecamp/oauth/oauth_error.rb', line 11 def retryable @retryable end |
#type ⇒ String
Error type ("validation", "auth", "network", "api_error")
11 12 13 |
# File 'lib/basecamp/oauth/oauth_error.rb', line 11 def type @type end |
Instance Method Details
#to_s ⇒ Object
27 28 29 30 31 32 |
# File 'lib/basecamp/oauth/oauth_error.rb', line 27 def to_s parts = [ "[#{type}] #{super}" ] parts << "(HTTP #{http_status})" if http_status parts << "Hint: #{hint}" if hint parts.join(" ") end |