Exception: RDF::ReaderError

Inherits:
IOError
  • Object
show all
Defined in:
vendor/bundler/ruby/3.0.0/bundler/gems/rdf-8de7b80ab60e/lib/rdf/reader.rb

Overview

The base class for RDF parsing errors.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Initializes a new lexer error instance.

Parameters:

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

    (nil)

  • lineno (Integer) (defaults to: nil)

    (nil)



712
713
714
715
716
# File 'vendor/bundler/ruby/3.0.0/bundler/gems/rdf-8de7b80ab60e/lib/rdf/reader.rb', line 712

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:



704
705
706
# File 'vendor/bundler/ruby/3.0.0/bundler/gems/rdf-8de7b80ab60e/lib/rdf/reader.rb', line 704

def lineno
  @lineno
end

#tokenString (readonly)

The invalid token which triggered the error.

Returns:



698
699
700
# File 'vendor/bundler/ruby/3.0.0/bundler/gems/rdf-8de7b80ab60e/lib/rdf/reader.rb', line 698

def token
  @token
end