Exception: Morpheus::Cli::CommandError

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

Overview

A standard error to raise in your CliCommand classes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, args = [], optparse = nil, exit_code = nil) ⇒ CommandError

Returns a new instance of CommandError.



8
9
10
11
12
13
# File 'lib/morpheus/cli/errors.rb', line 8

def initialize(msg, args=[], optparse=nil, exit_code=nil)
  @args = args
  @optparse = optparse
  @exit_code = exit_code # || 1
  super(msg)
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



6
7
8
# File 'lib/morpheus/cli/errors.rb', line 6

def args
  @args
end

#exit_codeObject (readonly)

Returns the value of attribute exit_code.



6
7
8
# File 'lib/morpheus/cli/errors.rb', line 6

def exit_code
  @exit_code
end

#optparseObject (readonly)

Returns the value of attribute optparse.



6
7
8
# File 'lib/morpheus/cli/errors.rb', line 6

def optparse
  @optparse
end