Exception: Quickl::InvalidOption

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

Overview

This error can be raised to indicate that some command option was misused. This error is automatically raised on occurence of an OptionParser::ParseError when options are parsed.

Default exit code:

-1

Default reaction:

raise Help.new(code), message, backtrace

Examples:

# Print message on $stderr and exit with -1
raise Quickl::InvalidOption, "--no-clue option does not exists"

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) ⇒ InvalidOption

Returns a new instance of InvalidOption.



137
138
139
# File 'lib/quickl/errors.rb', line 137

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

Instance Method Details

#react!Object

Raises:



141
142
143
# File 'lib/quickl/errors.rb', line 141

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