From 8f39a1403d3c94f3d51693e41843750352408cba Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Thu, 29 Mar 2018 08:32:54 +0100 Subject: Address numerous errors in test suites Many errors still remian. --- src/errors/errorware.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/errors/errorware.ts') diff --git a/src/errors/errorware.ts b/src/errors/errorware.ts index 05c714d..6d87bcb 100644 --- a/src/errors/errorware.ts +++ b/src/errors/errorware.ts @@ -28,7 +28,7 @@ export class RequestError extends Error { * @returns `true` if the object is a [[RequestError]]; `false` * otherwise. */ - public static is(test: Object): test is RequestError { + public static is(test: object): test is RequestError { return (test as Partial).code !== undefined && (test as Partial).name !== undefined && (test as Partial).responseBlock !== undefined; @@ -110,9 +110,11 @@ export type Errorware = * @param err The Error to act on. * @param req The Express http request. * @param res The Express http response. + * @param next The next Express middleware function. */ -export const errorHandler: Errorware = - (err: Error, req: Request, res: Response): void => { +export const errorHandler: Errorware = ( + err: Error, req: Request, res: Response, next: NextFunction +): void => { if (RequestError.is(err)) { res.status(err.code) .json(err.responseBlock()); -- cgit v1.2.1