Exception: JSONAPI::Exceptions::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- JSONAPI::Exceptions::Error
- Defined in:
- lib/jsonapi/exceptions.rb
Direct Known Subclasses
BadRequest, Errors, FilterNotAllowed, InternalServerError, InvalidDataFormat, InvalidField, InvalidFieldFormat, InvalidFieldValue, InvalidFilterValue, InvalidFiltersSyntax, InvalidInclude, InvalidLinksObject, InvalidPageObject, InvalidPageValue, InvalidRelationship, InvalidRequestFormat, InvalidResource, InvalidSortCriteria, KeyNotIncludedInURL, MissingKey, NotAcceptableError, PageParametersNotAllowed, ParameterMissing, ParameterNotAllowed, RecordLocked, RecordNotFound, SaveFailed, ToManySetReplacementForbidden, TypeMismatch, UnsupportedMediaTypeError, ValidationErrors
Instance Attribute Summary collapse
-
#error_object_overrides ⇒ Object
readonly
Returns the value of attribute error_object_overrides.
Instance Method Summary collapse
- #create_error_object(error_defaults) ⇒ Object
- #errors ⇒ Object
-
#initialize(error_object_overrides = {}) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(error_object_overrides = {}) ⇒ Error
Returns a new instance of Error.
6 7 8 |
# File 'lib/jsonapi/exceptions.rb', line 6 def initialize(error_object_overrides = {}) @error_object_overrides = error_object_overrides end |
Instance Attribute Details
#error_object_overrides ⇒ Object (readonly)
Returns the value of attribute error_object_overrides.
4 5 6 |
# File 'lib/jsonapi/exceptions.rb', line 4 def error_object_overrides @error_object_overrides end |
Instance Method Details
#create_error_object(error_defaults) ⇒ Object
10 11 12 |
# File 'lib/jsonapi/exceptions.rb', line 10 def create_error_object(error_defaults) JSONAPI::Error.new(error_defaults.merge(error_object_overrides)) end |
#errors ⇒ Object
14 15 16 17 18 |
# File 'lib/jsonapi/exceptions.rb', line 14 def errors # :nocov: raise NotImplementedError, "Subclass of Error must implement errors method" # :nocov: end |