Module: Mix::ExceptionWrapper
- Defined in:
- lib/clients/exception_wrapper.rb
Overview
Provides #try method that nicely wraps WIN32OLE exception handling in host classes
Instance Method Summary collapse
-
#try ⇒ Object
Exception handling wrapper for Win32OLE exceptions.
Instance Method Details
#try ⇒ Object
Exception handling wrapper for Win32OLE exceptions. Catch/log Win32OLE exceptions, pass on all others…
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/clients/exception_wrapper.rb', line 9 def try yield rescue WIN32OLERuntimeError => e puts :error, "Ignoring caught Win32ole runtime error:", e sleep 0.1 # Give other Threads a chance to execute rescue Exception => e self.finalize if respond_to? :finalize puts :error, "Raising non-Win32ole error:", e raise e end |