Exception: Jitsu::SyntaxError

Inherits:
JitsuError
  • Object
show all
Defined in:
lib/jitsu/errors.rb

Overview

Jitsufile syntax error.

Instance Method Summary collapse

Constructor Details

#initialize(jitsufile, msg, errors = nil) ⇒ SyntaxError

Construct a new SyntaxError.

Parameters:

  • jitsufile (String)

    path to file where error happened.

  • msg (String)

     error message.

  • errors (Enumerable) (defaults to: nil)

    list of errors from Kwalify, or nil.



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/jitsu/errors.rb', line 32

def initialize(jitsufile, msg, errors=nil)
  message = msg
  if errors and errors.is_a?(Enumerable)and not errors.empty?
  message << ":"
    errors.each do |err|
      message << "\n"
      message << (err.filename ? err.filename : jitsufile) << ":"
      message << (err.linenum ? "#{err.linenum}" : "0") << ":"
      message << err.path << " -- " << err.message
    end
  end
  super(message)
end