lib/quickl/errors.rb in quickl-0.1.1 vs lib/quickl/errors.rb in quickl-0.2.0
- old
+ new
@@ -171,11 +171,11 @@
end # class InvalidArgument
#
# This error can be raised to indicate that a command has not been
- # found (typically by delegates).
+ # found (typically by delegators).
#
# Default exit code:
# -1
#
# Default reaction:
@@ -190,7 +190,29 @@
def react!
raise Help.new(self.exit_code), self.message, backtrace
end
end # class NoSuchCommand
+
+ #
+ # This error can be raised to indicate that some file/dir
+ # access has failed.
+ #
+ # Default exit code:
+ # -1
+ #
+ # Default reaction:
+ # raise Exit.new(code), message, backtrace
+ #
+ class IOAccessError < Error
+
+ def initialize(*args)
+ super(*(args + [ -1 ]))
+ end
+
+ def react!
+ raise Exit.new(self.exit_code), self.message, backtrace
+ end
+
+ end # class IOAccessError
end # module Quickl
\ No newline at end of file