Table of Contents

Class ExceptionTranslator

Namespace
Loehnert.Lisrt.Messaging.Exceptions
Assembly
Loehnert.Lisrt.dll

A Translator for exceptions to L-exceptions.

public class ExceptionTranslator
Inheritance
ExceptionTranslator
Inherited Members

Constructors

ExceptionTranslator(IEnumerable<ITranslatableException>)

Initializes a new instance of the ExceptionTranslator class.

public ExceptionTranslator(IEnumerable<ITranslatableException> exceptions)

Parameters

exceptions IEnumerable<ITranslatableException>

Exceptions for translation.

Exceptions

ArgumentNullException

Thrown when exception is null.

Methods

Add(Type, Type)

Adds an message translation to the translator.

public void Add(Type originalType, Type translatedType)

Parameters

originalType Type

The original exception which will be translated.

translatedType Type

The target exception which replaces the original.

Exceptions

ArgumentException

Thrown when originalType isn't assignable from Exception or translatedType isn't assignable from Exception or translatedType has not a constructor with one parameter of type originalType.

Translate(Exception)

Translate the exception to the defined one.

public Exception Translate(Exception ex)

Parameters

ex Exception

Exception to translate.

Returns

Exception

Translated Exception when in dictionary.

Exceptions

ArgumentNullException

Thrown when ex is null.