Class ExceptionExtensions
Extensions for System.Exception.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
Namespace: Loehnert.Lisrt.Messaging.Exceptions
Assembly: Loehnert.Lisrt.dll
Syntax
public static class ExceptionExtensions
Methods
AddModuleInformation(Exception, ILisrtModule)
Adds information about the module to the exception.
Declaration
public static void AddModuleInformation(this Exception ex, ILisrtModule module)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | ex | The exception which gets more information. |
ILisrtModule | module | Module with the information. |
GetModule(Exception)
Tries to get a ILisrtModule implementation from exception data.
Declaration
public static ILisrtModule GetModule(this Exception ex)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | ex | Exception with module information. |
Returns
Type | Description |
---|---|
ILisrtModule | Null or module. |
Remarks
The module full name is saved in System.Exception.Data with key Loehnert.Lisrt.Messaging.MessageService.ModuleFullnameKey.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when an argument is null. |
ThrowWithModuleInformation(Exception, ILisrtModule)
Adds information about the module to the exception and throws it.
Declaration
public static void ThrowWithModuleInformation(this Exception ex, ILisrtModule module)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | ex | The exception which gets more information. |
ILisrtModule | module | Module with the information. |