UNPKG

843 BTypeScriptView Raw
1import * as Errors from "./Errors";
2/**
3 * Handles general errors and all client request errors.
4 * Client response errors are classified so that proper response error is generated.
5 */
6export declare class ErrorHandler {
7 /**
8 * Build general Postmark error.
9 *
10 * @param errorMessage - error message that needs to be identified and transformed to proper Postmark error.
11 *
12 * @returns properly formatted Postmark error.
13 */
14 buildError(errorMessage: string, code?: number, statusCode?: number): Errors.PostmarkError | Errors.HttpError;
15 /**
16 * Build Postmark error based on HTTP request status.
17 *
18 * @param error - http request library error, that will be transformed to Postmark error.
19 *
20 * @returns properly formatted Postmark error.
21 */
22 private buildErrorByHttpStatusCode;
23}