Exception: RDF::ReaderError

Inherits:
IOError
  • Object
show all
Defined in:
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 '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:

  • (Integer)


706
707
708
# File 'lib/rdf/reader.rb', line 706

def lineno
  @lineno
end

#tokenString (readonly)

The invalid token which triggered the error.

Returns:

  • (String)


700
701
702
# File 'lib/rdf/reader.rb', line 700

def token
  @token
end