Exception: RDF::ReaderError

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



670
671
672
673
674
# File 'vendor/bundler/ruby/2.4.0/bundler/gems/rdf-da525ad24ff7/lib/rdf/reader.rb', line 670

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:



662
663
664
# File 'vendor/bundler/ruby/2.4.0/bundler/gems/rdf-da525ad24ff7/lib/rdf/reader.rb', line 662

def lineno
  @lineno
end

#tokenString (readonly)

The invalid token which triggered the error.

Returns:



656
657
658
# File 'vendor/bundler/ruby/2.4.0/bundler/gems/rdf-da525ad24ff7/lib/rdf/reader.rb', line 656

def token
  @token
end