Exception: Nodepile::InputColumnSpecs::InvalidRecordError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/nodepile/colspecs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg) ⇒ InvalidRecordError

Returns a new instance of InvalidRecordError.



30
# File 'lib/nodepile/colspecs.rb', line 30

def initialize(msg) = @msg = msg

Instance Attribute Details

#file_pathObject

use to add error detail



29
30
31
# File 'lib/nodepile/colspecs.rb', line 29

def file_path
  @file_path
end

#rec_numObject

use to add error detail



29
30
31
# File 'lib/nodepile/colspecs.rb', line 29

def rec_num
  @rec_num
end

Instance Method Details

#messageObject



31
32
33
34
# File 'lib/nodepile/colspecs.rb', line 31

def message
    prefix = "Nodepile parsing error at record [#{self.rec_num||'?'}] from source [#{self.file_path||'?'}]: "
    return (!self.rec_num.nil? || !self.file_path.nil?) ? (prefix + @msg) : @msg
end