Skip to content

Commit a9330d4

Browse files
authored
Add new Error types
1 parent 6acd197 commit a9330d4

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

index.d.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
APIGatewayEvent,
33
APIGatewayEventRequestContext,
4-
Context,
4+
Context
55
} from 'aws-lambda';
66

77
export declare interface CookieOptions {
@@ -195,6 +195,26 @@ export declare class API {
195195
run(event: APIGatewayEvent, context: Context): {};
196196
}
197197

198+
export declare class RouteError extends Error {
199+
constructor(message: string, path: string);
200+
}
201+
202+
export declare class MethodError extends Error {
203+
constructor(message: string, method: METHODS, path: string);
204+
}
205+
206+
export declare class ConfigurationError extends Error {
207+
constructor(message: string);
208+
}
209+
210+
export declare class ResponseError extends Error {
211+
constructor(message: string, code: number);
212+
}
213+
214+
export declare class FileError extends Error {
215+
constructor(message: string, err: object);
216+
}
217+
198218
declare function createAPI(options?: Options): API;
199219

200220
export default createAPI;

0 commit comments

Comments
 (0)