Class: Redbreast::ErrorHandler
- Inherits:
-
Object
- Object
- Redbreast::ErrorHandler
- Extended by:
- Helper::Terminal
- Defined in:
- lib/redbreast/error_handler.rb
Overview
Class for handling errors that occurr
Class Method Summary collapse
Methods included from Helper::Terminal
Class Method Details
.handle(error) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/redbreast/error_handler.rb', line 13 def handle(error) prompt.error( case error when Errno::ENOENT "We could not find a file that we need:\n\n#{error.}" else "An error happened. This might help:\n\n#{error.}" end ) end |
.rescuable ⇒ Object
7 8 9 10 11 |
# File 'lib/redbreast/error_handler.rb', line 7 def rescuable yield rescue StandardError => e handle(e) end |