Exception: Quickl::InvalidArgument

Inherits:
Error show all
Defined in:
lib/quickl/errors.rb

Overview

This error can be raised to indicate that some command argument was misused.

Default exit code:

-1

Default reaction:

raise Help.new(code), message, backtrace

Examples:

# Print message on $stderr and exit with -1
raise Quickl::InvalidArgument, "Missing command argument"

Instance Attribute Summary

Attributes inherited from Error

#command, #exit_code

Instance Method Summary collapse

Methods inherited from Error

#do_kernel_exit, #error_io, #exit?

Constructor Details

#initialize(*args) ⇒ InvalidArgument

Returns a new instance of InvalidArgument.



164
165
166
# File 'lib/quickl/errors.rb', line 164

def initialize(*args)
  super(*(args + [ -1 ]))
end

Instance Method Details

#react!Object

Raises:



168
169
170
# File 'lib/quickl/errors.rb', line 168

def react!
  raise Help.new(self.exit_code), self.message, backtrace
end