Exception: Securial::Error::BaseError
- Inherits:
-
StandardError
- Object
- StandardError
- Securial::Error::BaseError
- Defined in:
- lib/securial/error/base_securial_error.rb
Overview
Base error class for all Securial-specific exceptions.
This class serves as the foundation for Securial’s error hierarchy, providing common functionality like default messages and backtrace customization. All specialized error types in Securial should inherit from this class.
Direct Known Subclasses
Auth::TokenDecodeError, Auth::TokenEncodeError, Auth::TokenExpiredError, Auth::TokenRevokedError, Config::InvalidConfigurationError
Class Method Summary collapse
-
.default_message(message = nil) ⇒ String?
Sets or gets the default message for this error class.
Instance Method Summary collapse
-
#backtrace ⇒ Array
Returns an empty backtrace.
-
#initialize(message = nil) ⇒ BaseError
constructor
Initializes a new error instance with the provided message or default.
Constructor Details
#initialize(message = nil) ⇒ BaseError
Initializes a new error instance with the provided message or default.
54 55 56 |
# File 'lib/securial/error/base_securial_error.rb', line 54 def initialize( = nil) super( || self.class. || "An error occurred in Securial") end |
Class Method Details
.default_message(message = nil) ⇒ String?
Sets or gets the default message for this error class.
This class method allows error classes to define a standard message that will be used when no explicit message is provided at instantiation.
44 45 46 47 |
# File 'lib/securial/error/base_securial_error.rb', line 44 def self.( = nil) self. = self. end |
Instance Method Details
#backtrace ⇒ Array
Returns an empty backtrace.
This method overrides the standard backtrace behavior to return an empty array, which helps keep error responses clean without showing internal implementation details in production environments.
66 |
# File 'lib/securial/error/base_securial_error.rb', line 66 def backtrace; []; end |