Exception: RDF::ReaderError

Inherits:
IOError
  • Object
show all
Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/rdf-884e3ef78084/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)



714
715
716
717
718
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-884e3ef78084/lib/rdf/reader.rb', line 714

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:



706
707
708
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-884e3ef78084/lib/rdf/reader.rb', line 706

def lineno
  @lineno
end

#tokenString (readonly)

The invalid token which triggered the error.

Returns:



700
701
702
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-884e3ef78084/lib/rdf/reader.rb', line 700

def token
  @token
end