Class ExceptionTranslator
A Translator for exceptions to L-exceptions.
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 class ExceptionTranslator
Constructors
ExceptionTranslator(IEnumerable<ITranslatableException>)
Initializes a new instance of the ExceptionTranslator class.
Declaration
public ExceptionTranslator(IEnumerable<ITranslatableException> exceptions)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ITranslatableException> | exceptions | Exceptions for translation. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when exception is null. |
Methods
Add(Type, Type)
Adds an message translation to the translator.
Declaration
public void Add(Type originalType, Type translatedType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | originalType | The original exception which will be translated. |
System.Type | translatedType | The target exception which replaces the original. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
Translate(Exception)
Translate the exception to the defined one.
Declaration
public Exception Translate(Exception ex)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | ex | Exception to translate. |
Returns
Type | Description |
---|---|
System.Exception | Translated Exception when in dictionary. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |