Exception: LD::Patch::ParseError
- Defined in:
- lib/ld/patch.rb
Overview
Indicates bad syntax found in LD Patch document
Instance Attribute Summary collapse
-
#lineno ⇒ Integer
readonly
The line number where the error occurred.
-
#token ⇒ String
readonly
The invalid token which triggered the error.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message, **options) ⇒ ParseError
constructor
Initializes a new parser error instance.
Constructor Details
#initialize(message, **options) ⇒ ParseError
Initializes a new parser error instance.
73 74 75 76 77 |
# File 'lib/ld/patch.rb', line 73 def initialize(, **) @token = [:token] @lineno = [:lineno] || (@token.lineno if @token.respond_to?(:lineno)) super(.to_s, code: .fetch(:code, 400)) end |
Instance Attribute Details
#lineno ⇒ Integer (readonly)
The line number where the error occurred.
63 64 65 |
# File 'lib/ld/patch.rb', line 63 def lineno @lineno end |
#token ⇒ String (readonly)
The invalid token which triggered the error.
57 58 59 |
# File 'lib/ld/patch.rb', line 57 def token @token end |