Exception: Cl::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cl/errors.rb

Constant Summary collapse

MSGS =
{
  unknown_cmd:    'Unknown command: %s',
  missing_args:   'Missing arguments (given: %s, required: %s)',
  too_many_args:  'Too many arguments (given: %s, allowed: %s)',
  wrong_type:     'Wrong argument type (given: %s, expected: %s)',
  out_of_range:   'Out of range: %s',
  invalid_format: 'Invalid format: %s',
  unknown_values: 'Unknown value: %s',
  required_opt:   'Missing required option: %s',
  required_opts:  'Missing required options: %s',
  requires_opt:   'Missing option: %s',
  requires_opts:  'Missing options: %s',
}

Instance Method Summary collapse

Constructor Details

#initialize(msg, *args) ⇒ Error


17
18
19
# File 'lib/cl/errors.rb', line 17

def initialize(msg, *args)
  super(MSGS[msg] ? MSGS[msg] % args : msg)
end