UNPKG

896 BTypeScriptView Raw
1/**
2 * @author: Prachi Singh (prachi@hackcapital.com)
3 * @date: Wednesday, 24th April 2019 9:50:37 am
4 * @lastModifiedBy: Prachi Singh (prachi@hackcapital.com)
5 * @lastModifiedTime: Monday, 6th May 2019 2:08:21 pm
6 *
7 * DESCRIPTION: Error type
8 *
9 * @copyright (c) 2019 Hack Capital
10 */
11import { IUNEXPECTED, IEXPECTED } from '../constants/errorSource';
12export interface IExtra {
13 exit?: boolean;
14 source?: IUNEXPECTED | IEXPECTED;
15}
16/**
17 * message and stack are stringified objects which can contain (Refer to @hackcapital/errors)
18 * message: {
19 * extra?: object,
20 * errorCode?: string,
21 * statusCode?: string,
22 * note: string
23 * }
24 */
25export interface IError {
26 name: string;
27 message: string;
28 stack: string;
29 errorCode?: string;
30 statusCode?: string;
31 extra: IExtra;
32}
33export interface ErrorObject {
34 requestID: string;
35 code: number;
36 message: string;
37}