Exception: ShEx::Error

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

Direct Known Subclasses

NotMatched, NotSatisfied, ParseError, 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}) (defaults to: {})

Options Hash (options):

  • :code (Integer) — default: 422


119
120
121
122
# File 'lib/shex.rb', line 119

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



111
112
113
# File 'lib/shex.rb', line 111

def code
  @code
end