Factory used to create a serializeable ErrorDescription from ApplicationError or from arbitrary errors.
Description
The ErrorDescriptionFactory class provides a factory to create a serializeable ErrorDescription from ApplicationError or from arbitrary errors.
Important points
- Error descriptions 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.
Methods
Create
Creates a serializable ErrorDescription from error object.
(c *TErrorDescriptionFactory) Create(err any) *ErrorDescription
- error: any - error object
- returns: *ErrorDescription - serializeable ErrorDescription object that describes the error.