class LD::Patch::ParseError

Indicates bad syntax found in LD Patch document

Attributes

lineno[R]

The line number where the error occurred.

@return [Integer]

token[R]

The invalid token which triggered the error.

@return [String]

Public Class Methods

new(message, **options) click to toggle source

Initializes a new parser error instance.

@param [String, to_s] message @param [Hash{Symbol => Object}] options @option options [String] :token (nil) @option options [Integer] :lineno (nil) @option options [Integer] :code (400)

Calls superclass method LD::Patch::Error::new
# File lib/ld/patch.rb, line 73
def initialize(message, **options)
  @token      = options[:token]
  @lineno     = options[:lineno] || (@token.lineno if @token.respond_to?(:lineno))
  super(message.to_s, code: options.fetch(:code, 400))
end