aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/exceptions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/leap_cli/exceptions.rb')
-rw-r--r--lib/leap_cli/exceptions.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/leap_cli/exceptions.rb b/lib/leap_cli/exceptions.rb
index cd27f14..24a0fa7 100644
--- a/lib/leap_cli/exceptions.rb
+++ b/lib/leap_cli/exceptions.rb
@@ -6,6 +6,30 @@ module LeapCli
@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