Exception: SHACL::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/shacl.rb

Direct Known Subclasses

StructureError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, **options) ⇒ Error

Initializes a new patch error instance.

Parameters:

  • message (String, #to_s)
  • options (Hash{Symbol => Object})

Options Hash (**options):

  • :code (Integer) — default: 422


85
86
87
88
# File 'lib/shacl.rb', line 85

def initialize(message, **options)
  @code = options.fetch(:status_code, 422)
  super(message.to_s)
end

Instance Attribute Details

#codeObject (readonly)

The status code associated with this error



77
78
79
# File 'lib/shacl.rb', line 77

def code
  @code
end