Exception: CitySDK::Exception

Inherits:
Exception
  • Object
show all
Defined in:
lib/citysdk/util.rb

Instance Method Summary collapse

Constructor Details

#initialize(message, parms = nil, srcfile = nil, srcline = nil) ⇒ Exception

Returns a new instance of Exception.



50
51
52
53
54
55
56
57
58
59
# File 'lib/citysdk/util.rb', line 50

def initialize(message,parms=nil,srcfile=nil,srcline=nil)
  if parms and srcfile and srcline
    file = File.basename( parms[:originalfile] ? parms[:originalfile] : ( parms[:file_path] || '-' ) )
    m = "#{Time.now.strftime("%b %M %Y, %H:%M")}; CitySDK, processing file: #{file}\n Exception in #{File.basename(srcfile)}, #{srcline}\n #{message}"
  else
    m = "#{Time.now.strftime("%b %M %Y, %H:%M")}; CitySDK Exception: #{message}"
  end
  super(m)
  $stderr.puts(m) if parms and parms[:verbose]
end