Exception: COM::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- COM::Error
- Defined in:
- lib/com/error.rb
Overview
Superclass for COM-related errors. This class is meant to be subclassed an used for refinement of otherwise very unspecific COM errors.
Direct Known Subclasses
Class Method Summary collapse
-
.from(error, backtrace = nil) ⇒ Object
Creates a COM::Error from error, with optional backtrace.
- .replaces?(error) ⇒ Boolean
Class Method Details
.from(error, backtrace = nil) ⇒ Object
Creates a COM::Error from error, with optional backtrace. Error should be an error raised by WIN32OLE.
This is an internal method.
17 18 19 20 21 |
# File 'lib/com/error.rb', line 17 def from(error, backtrace = nil) errors.find{ |replacement| replacement.replaces? error }.replace(error).tap{ |e| e.set_backtrace backtrace if backtrace } end |
.replaces?(error) ⇒ Boolean
24 25 26 |
# File 'lib/com/error.rb', line 24 def replaces?(error) true end |