Exception: RDF::ReaderError

Inherits:
IOError
  • Object
show all
Defined in:
vendor/bundler/ruby/2.6.0/bundler/gems/rdf-7506695c9b4f/lib/rdf/reader.rb

Overview

The base class for RDF parsing errors.

Direct Known Subclasses

Tabular::Error, Turtle::Reader::SyntaxError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Initializes a new lexer error instance.

Parameters:



674
675
676
677
678
# File 'vendor/bundler/ruby/2.6.0/bundler/gems/rdf-7506695c9b4f/lib/rdf/reader.rb', line 674

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:



666
667
668
# File 'vendor/bundler/ruby/2.6.0/bundler/gems/rdf-7506695c9b4f/lib/rdf/reader.rb', line 666

def lineno
  @lineno
end

#tokenString (readonly)

The invalid token which triggered the error.

Returns:



660
661
662
# File 'vendor/bundler/ruby/2.6.0/bundler/gems/rdf-7506695c9b4f/lib/rdf/reader.rb', line 660

def token
  @token
end