Exception: JSONAPI::Exceptions::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/jsonapi/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_overridesObject (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

#errorsObject

Raises:

  • (NotImplementedError)


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