Module: Rumonade::ErrorHandling
- Defined in:
- lib/rumonade/error_handling.rb
Overview
Classes representing the components of exception handling. Each class is independently composable. Some example usages:
require "rumonade"
require "uri"
s = "http://"
x1 = catching(URI::InvalidURIError).opt { URI.parse(s) }
x2 = catching(URI::InvalidURIError, NoMethodError).either { URI.parse(s) }
Instance Method Summary collapse
-
#should_reraise?(ex) ⇒ Boolean
Should re-raise exceptions like
Interrupt
andNoMemoryError
by default.
Instance Method Details
#should_reraise?(ex) ⇒ Boolean
Should re-raise exceptions like Interrupt
and NoMemoryError
by default.
60 61 62 63 64 65 |
# File 'lib/rumonade/error_handling.rb', line 60 def should_reraise?(ex) case ex when StandardError; false else true end end |