Exception: ComplexConfig::ComplexConfigError Abstract
- Defined in:
- lib/complex_config/errors.rb
Overview
This class is abstract.
Abstract base class for ComplexConfig exceptions
This class serves as the root of the exception hierarchy for the ComplexConfig library. All custom exceptions raised by ComplexConfig should inherit from this class.
Direct Known Subclasses
AttributeMissing, ConfigurationFileMissing, ConfigurationSyntaxError, EncryptionError
Class Method Summary collapse
-
.wrap(klass, e) ⇒ ComplexConfig::ComplexConfigError
Wraps an exception with a custom error class from the ComplexConfig hierarchy.
Class Method Details
.wrap(klass, e) ⇒ ComplexConfig::ComplexConfigError
Wraps an exception with a custom error class from the ComplexConfig hierarchy
This method takes an exception and wraps it with a new error class that is derived from the ComplexConfig error hierarchy. It allows for more specific error handling by converting one type of exception into another while preserving the original message and backtrace.
25 26 27 28 29 30 |
# File 'lib/complex_config/errors.rb', line 25 def self.wrap(klass, e) Class === klass or klass = ComplexConfig.const_get(klass) error = klass.new(e.) error.set_backtrace(e.backtrace) error end |