Class ScyllaModuleException
Represents errors that occur during Scylla module operations, including registration, dependency validation, initialization, lifecycle transitions, and runtime failures. Optionally carries the ID of the module that triggered the error to make diagnostic messages more actionable.
Implements
Inherited Members
Namespace: Scylla.Core.Modules
Assembly: ScyllaCore.dll
Syntax
public class ScyllaModuleException : Exception, ISerializable
Remarks
The framework throws or catches ScyllaModuleException at key points in
the module lifecycle:
- Failed dependency validation in ValidateAllDependencies().
- Unrecoverable errors thrown from Initialize().
- Runtime failures reported by concrete modules.
When a ScyllaModuleException is caught by the framework during
initialization, the faulting module is transitioned to
Error and the fail-fast rollback sequence is
triggered.
Prefer the overloads that accept a moduleID parameter when the
exception originates from a known module. Use the constants in
ScyllaModuleID so that IDs are consistent with those registered
in IScyllaModuleManager.
Constructors
ScyllaModuleException(string)
Initializes a new ScyllaModuleException with the given error
message. Use this overload when the exception does not originate from a
specific identifiable module (e.g., framework-level errors). The
ModuleID property will be null.
Declaration
public ScyllaModuleException(string message)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | A description of the error. Should be clear and actionable so that developers can diagnose the problem from log output alone. |
ScyllaModuleException(string, Exception)
Initializes a new ScyllaModuleException with the given error
message and an inner exception that is the root cause. Use this overload to
wrap lower-level exceptions (e.g., InvalidOperationException,
NullReferenceException) that surfaced during a module operation,
preserving the original stack trace. The ModuleID property will
be null.
Declaration
public ScyllaModuleException(string message, Exception innerException)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | A description of the high-level module operation that failed. |
| Exception | innerException | The exception that is the cause of this exception. Pass the original exception caught in the module's lifecycle method to preserve its stack trace. |
ScyllaModuleException(string, string)
Initializes a new ScyllaModuleException with the given error message and the ID of the module that caused the error. Use this overload whenever the faulting module is known - it produces more informative log output via ToString().
Declaration
public ScyllaModuleException(string message, string moduleID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | A description of the error. Should be clear and actionable so that developers can diagnose the problem from log output alone. |
| string | moduleID | The unique ID of the module responsible for this exception. Use a constant from ScyllaModuleID for built-in modules to ensure the ID is consistent with what is registered in the IScyllaModuleManager. |
ScyllaModuleException(string, string, Exception)
Initializes a new ScyllaModuleException with the given error message, the ID of the responsible module, and an inner exception that is the root cause. This is the most descriptive overload and should be preferred when both pieces of context are available.
Declaration
public ScyllaModuleException(string message, string moduleID, Exception innerException)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | A description of the high-level module operation that failed. |
| string | moduleID | The unique ID of the module responsible for this exception. Use a constant from ScyllaModuleID for built-in modules to ensure the ID is consistent with what is registered in the IScyllaModuleManager. |
| Exception | innerException | The exception that is the cause of this exception. Pass the original exception caught in the module's lifecycle method to preserve its stack trace. |
Properties
ModuleID
Gets the unique ID of the module that caused this exception, if known.
Declaration
public string ModuleID { get; }
Property Value
| Type | Description |
|---|---|
| string | The module ID string (e.g., |
See Also
Methods
ToString()
Returns a formatted error message that includes the module ID (when available) and the exception message, suitable for log output and crash reports.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
|