Exception: ShEx::ParseError

Inherits:
Error show all
Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/shex-f64040a493d0/lib/shex.rb

Overview

Indicates bad syntax found in LD Patch document

Instance Attribute Summary collapse

Attributes inherited from Error

#code

Instance Method Summary collapse

Constructor Details

#initialize(message, token: nil, lineno: nil) ⇒ ParseError

ParseError includes token and lineno associated with the expression.

Parameters:

  • message (String, #to_s)
  • token (String) (defaults to: nil)

    (nil)

  • lineno (Integer) (defaults to: nil)

    (nil)



196
197
198
199
200
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/shex-f64040a493d0/lib/shex.rb', line 196

def initialize(message, token: nil, lineno: nil)
  @token      = token
  @lineno     = lineno || (@token.lineno if @token.respond_to?(:lineno))
  super(message.to_s)
end

Instance Attribute Details

#linenoInteger (readonly)

The line number where the error occurred.

Returns:



188
189
190
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/shex-f64040a493d0/lib/shex.rb', line 188

def lineno
  @lineno
end

#tokenString (readonly)

The invalid token which triggered the error.

Returns:



182
183
184
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/shex-f64040a493d0/lib/shex.rb', line 182

def token
  @token
end