UNPKG

1.8 kBTypeScriptView Raw
1/**
2 * Standard Postmark error on which all sub-errors are based.
3 */
4export declare class PostmarkError extends Error {
5 code: number;
6 statusCode: number;
7 constructor(message: string, code?: number, statusCode?: number);
8 protected setUpStackTrace(): void;
9}
10export declare class HttpError extends PostmarkError {
11 constructor(message: string, code: number, statusCode: number);
12}
13export declare class InvalidAPIKeyError extends HttpError {
14 constructor(message: string, code: number, statusCode: number);
15}
16export declare class InternalServerError extends HttpError {
17 constructor(message: string, code: number, statusCode: number);
18}
19export declare class ServiceUnavailablerError extends HttpError {
20 constructor(message: string, code: number, statusCode: number);
21}
22export declare class RateLimitExceededError extends HttpError {
23 constructor(message: string, code: number, statusCode: number);
24}
25export declare class UnknownError extends HttpError {
26 constructor(message: string, code: number, statusCode: number);
27}
28export declare class ApiInputError extends HttpError {
29 static ERROR_CODES: {
30 inactiveRecipient: number;
31 invalidEmailRequest: number;
32 };
33 constructor(message: string, code: number, statusCode: number);
34 static buildSpecificError(message: string, code: number, statusCode: number): ApiInputError;
35}
36export declare class InactiveRecipientsError extends ApiInputError {
37 static inactiveRecipientsPatterns: RegExp[];
38 recipients: string[];
39 constructor(message: string, code: number, statusCode: number);
40 static parseInactiveRecipients(message: string): string[];
41}
42export declare class InvalidEmailRequestError extends ApiInputError {
43 constructor(message: string, code: number, statusCode: number);
44}