Exception: Scimitar::ErrorResponse
- Inherits:
-
StandardError
- Object
- StandardError
- Scimitar::ErrorResponse
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/scimitar/error_response.rb
Direct Known Subclasses
AuthenticationError, FilterError, InvalidSyntaxError, NotFoundError, ResourceInvalidError
Instance Attribute Summary collapse
-
#detail ⇒ Object
Returns the value of attribute detail.
-
#scimType ⇒ Object
Returns the value of attribute scimType.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#message ⇒ Object
Originally Scimitar used attribute “detail” for exception text; it was only for JSON responses at the time, but in hindsight was a bad choice.
Instance Attribute Details
#detail ⇒ Object
Returns the value of attribute detail.
5 6 7 |
# File 'app/models/scimitar/error_response.rb', line 5 def detail @detail end |
#scimType ⇒ Object
Returns the value of attribute scimType.
5 6 7 |
# File 'app/models/scimitar/error_response.rb', line 5 def scimType @scimType end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'app/models/scimitar/error_response.rb', line 5 def status @status end |
Instance Method Details
#as_json(options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'app/models/scimitar/error_response.rb', line 9 def as_json( = {}) data = { 'schemas': ['urn:ietf:params:scim:api:messages:2.0:Error'], 'detail': detail, 'status': "#{status}" } data['scimType'] = scimType if scimType data end |
#message ⇒ Object
Originally Scimitar used attribute “detail” for exception text; it was only for JSON responses at the time, but in hindsight was a bad choice. It should have been “message” given inheritance from StandardError, which then works properly with e.g. error reporting services.
The “detail” attribute is still present, for backwards compatibility with any client code that might be using this class.
28 29 30 |
# File 'app/models/scimitar/error_response.rb', line 28 def self.detail end |