Module: Canoe::Err

Included in:
CmdParser, DepAnalyzer, DepAnalyzer, WorkSpace, ConfigReader
Defined in:
lib/util.rb

Overview

Colorized error messages with abortion

Instance Method Summary collapse

Instance Method Details

#abort_on_err(err) ⇒ Object



90
91
92
93
94
95
96
# File 'lib/util.rb', line 90

def abort_on_err(err)
  abort <<~ERR
        #{'Fatal: '.red}
            #{err}
        try 'canoe help' for more information
      ERR
end

#warn_on_err(err) ⇒ Object



82
83
84
85
86
87
88
# File 'lib/util.rb', line 82

def warn_on_err(err)
  puts <<~ERR
       #{'Waring: '.yellow}
           #{err}
       try 'canoe help' for more information
     ERR
end