Exception: RDF::ReaderError

Inherits:
IOError
  • Object
show all
Defined in:
vendor/bundler/ruby/2.5.0/bundler/gems/rdf-491e9bb5b443/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:



672
673
674
675
676
# File 'vendor/bundler/ruby/2.5.0/bundler/gems/rdf-491e9bb5b443/lib/rdf/reader.rb', line 672

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:



664
665
666
# File 'vendor/bundler/ruby/2.5.0/bundler/gems/rdf-491e9bb5b443/lib/rdf/reader.rb', line 664

def lineno
  @lineno
end

#tokenString (readonly)

The invalid token which triggered the error.

Returns:



658
659
660
# File 'vendor/bundler/ruby/2.5.0/bundler/gems/rdf-491e9bb5b443/lib/rdf/reader.rb', line 658

def token
  @token
end