Class: Morpheus::Cli::ErrorHandler

Inherits:
Object
  • Object
show all
Includes:
Term::ANSIColor
Defined in:
lib/morpheus/cli/error_handler.rb

Instance Method Summary collapse

Instance Method Details



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/morpheus/cli/error_handler.rb', line 10

def print_errors(response)
  if !response['success']
    print red,bold, "\n"
    if response['msg']
      puts response['msg']
    end
    if response['errors']
      response['errors'].each do |key, value|
        print "* #{key}: #{value}\n"
      end
    end
    print reset, "\n"
  end
end