Class: ThreeScaleToolbox::CLI::ErrorHandler
- Inherits:
-
Object
- Object
- ThreeScaleToolbox::CLI::ErrorHandler
- Defined in:
- lib/3scale_toolbox/cli/error_handler.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#error_watchdog ⇒ Object
Catches errors and prints nice diagnostic messages.
Class Method Details
.error_watchdog ⇒ Object
4 5 6 |
# File 'lib/3scale_toolbox/cli/error_handler.rb', line 4 def self.error_watchdog new.error_watchdog { yield } end |
Instance Method Details
#error_watchdog ⇒ Object
Catches errors and prints nice diagnostic messages
9 10 11 12 13 14 15 16 17 |
# File 'lib/3scale_toolbox/cli/error_handler.rb', line 9 def error_watchdog # Run yield rescue StandardError, ScriptError => e handle_error e e else nil end |