lib/leap_cli/exceptions.rb in leap_cli-1.5.6 vs lib/leap_cli/exceptions.rb in leap_cli-1.6.2
- old
+ new
@@ -4,8 +4,32 @@
attr_accessor :node
def initialize(node, msg)
@node = node
super(msg)
end
+ def log
+ Util.log(0, :error, "in node `#{@node.name}`: " + self.message)
+ end
+ end
+
+ class FileMissing < StandardError
+ attr_accessor :path, :options
+ def initialize(path, options={})
+ @path = path
+ @options = options
+ end
+ def to_s
+ @path
+ end
+ end
+
+ class AssertionFailed < StandardError
+ attr_accessor :assertion
+ def initialize(assertion)
+ @assertion = assertion
+ end
+ def to_s
+ @assertion
+ end
end
end
\ No newline at end of file