Exception: BPM::InvalidPackageError

Inherits:
Error
  • Object
show all
Defined in:
lib/bpm/errors.rb

Direct Known Subclasses

InvalidPackagePathError

Instance Method Summary collapse

Methods inherited from Error

#initialize

Constructor Details

This class inherits a constructor from BPM::Error

Instance Method Details

#format_message(package, msg = nil) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/bpm/errors.rb', line 15

def format_message(package, msg=nil)
  msg = msg.nil? ? '' : ": #{msg}"
  path = begin
    Pathname.new(package.json_path).relative_path_from(Pathname.new(Dir.pwd))
  rescue
    package.json_path
  end
  "There was a problem parsing #{path}#{msg}"
end