UNPKG

802 BTypeScriptView Raw
1import { ErrorDescription } from './ErrorDescription';
2/**
3 * Factory to create serializeable [[ErrorDescription]] from [[ApplicationException]]
4 * or from arbitrary errors.
5 *
6 * The ErrorDescriptions are used to pass errors through the wire between microservices
7 * implemented in different languages. They allow to restore exceptions on the receiving side
8 * close to the original type and preserve additional information.
9 *
10 * @see [[ErrorDescription]]
11 * @see [[ApplicationException]]
12 */
13export declare class ErrorDescriptionFactory {
14 /**
15 * Creates a serializable ErrorDescription from error object.
16 *
17 * @param error an error object
18 * @returns a serializeable ErrorDescription object that describes the error.
19 */
20 static create(error: any): ErrorDescription;
21}