Module: DBStruct::ErrorHelpers
Overview
Error checking needs to be global, so we put it in a module and import it everywhere.
Instance Method Summary collapse
-
#check(message, exception = Failure, &block) ⇒ Object
Error check: if block evaluates to false, raise a Lite3::DBM::Error with the given message.
- #oops(msg) ⇒ Object
Instance Method Details
#check(message, exception = Failure, &block) ⇒ Object
Error check: if block evaluates to false, raise a Lite3::DBM::Error with the given message.
27 28 29 30 |
# File 'lib/internal/error.rb', line 27 def check(, exception = Failure, &block) return if block && block.call raise exception.new() end |