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 error instance.

Parameters:

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

Options Hash (**options):

  • :code (Integer) — default: 422


90
91
92
93
# File 'lib/shacl.rb', line 90

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



82
83
84
# File 'lib/shacl.rb', line 82

def code
  @code
end