Exception: HammerCLI::TaskHelper::I18n::TxApiClient::GeneralError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/hammer_cli/task_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ GeneralError

Returns a new instance of GeneralError.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/hammer_cli/task_helper.rb', line 11

def initialize(error)
  msg = case error
  when Hash
    "#{error['title']}: #{error['detail']}"
  when Array
    error.join("\n")
  else
    error.to_s
  end
  super(msg)
end