Class: PointRb::Actions::ErrorHandlerCommandline
- Inherits:
-
Object
- Object
- PointRb::Actions::ErrorHandlerCommandline
- Defined in:
- lib/pointrb/actions/error_handler_commandline.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ErrorHandlerCommandline
constructor
A new instance of ErrorHandlerCommandline.
Constructor Details
#initialize(app) ⇒ ErrorHandlerCommandline
Returns a new instance of ErrorHandlerCommandline.
4 5 6 |
# File 'lib/pointrb/actions/error_handler_commandline.rb', line 4 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/pointrb/actions/error_handler_commandline.rb', line 8 def call(env) begin @app.call(env) rescue Exceptions::SyntaxErrorInLayout => e error_msg e., 1 rescue Exceptions::ProjectPathExists => e error_msg e., 2 rescue Exceptions::PointRbWasAlreadInitialized => e error_msg e., 3 rescue Exceptions::LayoutNotFound => e error_msg e., 4 rescue Exception => e if env.[:verbose] = e. else = 'An unknown error occured. If you would like to see a more verbose output, then please use the --verbose option.' end error_msg , -1 end end |