Class: Racket::Utils::Exceptions::ExceptionHandler
- Inherits:
-
Object
- Object
- Racket::Utils::Exceptions::ExceptionHandler
- Defined in:
- lib/racket/utils/exceptions.rb
Overview
Handles exceptions dynamically
Class Method Summary collapse
-
.run_block(errors) ⇒ true|flase
Runs a block.
Class Method Details
.run_block(errors) ⇒ true|flase
Runs a block. If no exceptions are raised, this method returns true. If any of the provided error types are raised, this method returns false. If any other exception is raised, this method will just forward the exception.
33 34 35 36 37 38 39 40 |
# File 'lib/racket/utils/exceptions.rb', line 33 def self.run_block(errors) raise 'Need a block' unless block_given? begin true.tap { yield } rescue boolean_module(errors) false end end |