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, options = {}) ⇒ ReaderError

Initializes a new lexer error instance.

Parameters:

  • message (String, #to_s)
  • options (Hash{Symbol => Object}) (defaults to: {})

Options Hash (options):

  • :token (String) — default: nil
  • :lineno (Integer) — default: nil


626
627
628
629
630
# File 'lib/rdf/reader.rb', line 626

def initialize(message, options = {})
  @token      = options[:token]
  @lineno     = options[: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)


617
618
619
# File 'lib/rdf/reader.rb', line 617

def lineno
  @lineno
end

#tokenString (readonly)

The invalid token which triggered the error.

Returns:

  • (String)


611
612
613
# File 'lib/rdf/reader.rb', line 611

def token
  @token
end