Pip-Services-Commons-Dotnet
Static Public Member Functions | Static Private Member Functions | List of all members
PipServices3.Commons.Errors.ErrorDescriptionFactory Class Reference

Factory to create serializeable ErrorDescription from ApplicationException or from arbitrary errors. More...

Static Public Member Functions

static ErrorDescription Create (ApplicationException ex)
 Creates a serializable ErrorDescription from error object. More...
 
static ErrorDescription Create (Exception ex, string correlationId=null)
 Creates a serializable ErrorDescription from throwable object with unknown error category. More...
 

Static Private Member Functions

static string ComposeCause (Exception error)
 

Detailed Description

Factory to create serializeable ErrorDescription from ApplicationException or from arbitrary errors.

The ErrorDescriptions are used to pass errors through the wire between microservices implemented in different languages.They allow to restore exceptions on the receiving side close to the original type and preserve additional information.

See ErrorDescription, ApplicationException

Member Function Documentation

◆ Create() [1/2]

static ErrorDescription PipServices3.Commons.Errors.ErrorDescriptionFactory.Create ( ApplicationException  ex)
static

Creates a serializable ErrorDescription from error object.

Parameters
exan error object
Returns
a serializeable ErrorDescription object that describes the error.

◆ Create() [2/2]

static ErrorDescription PipServices3.Commons.Errors.ErrorDescriptionFactory.Create ( Exception  ex,
string  correlationId = null 
)
static

Creates a serializable ErrorDescription from throwable object with unknown error category.

Parameters
exan error object
correlationId(optional) a unique transaction id to trace execution through call chain.
Returns
a serializeable ErrorDescription object that describes the error.

The documentation for this class was generated from the following file: