Class: Gitlab::BeyondIdentity::Client::ApiError
- Inherits:
-
Object
- Object
- Gitlab::BeyondIdentity::Client::ApiError
- Defined in:
- lib/gitlab/beyond_identity/client.rb
Constant Summary collapse
- ACCEPTABLE_ERROR_CODES =
[404].freeze
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#acceptable_error? ⇒ Boolean
In some cases, we treat error response as acceptable:.
-
#initialize(message, code) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(message, code) ⇒ ApiError
Returns a new instance of ApiError.
15 16 17 18 |
# File 'lib/gitlab/beyond_identity/client.rb', line 15 def initialize(, code) @code = code @message = end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
13 14 15 |
# File 'lib/gitlab/beyond_identity/client.rb', line 13 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
13 14 15 |
# File 'lib/gitlab/beyond_identity/client.rb', line 13 def @message end |
Instance Method Details
#acceptable_error? ⇒ Boolean
In some cases, we treat error response as acceptable:
A GPG key that wasn’t issued by BeyondIdentity returns 404 status code but users should be able to add those GPG keys to their profile.
24 25 26 |
# File 'lib/gitlab/beyond_identity/client.rb', line 24 def acceptable_error? ACCEPTABLE_ERROR_CODES.include?(code) end |