Skip to content

Commit 5838e49

Browse files
fix: in Koa2 interface await next as a function (#336)
* fix: in Koa2 interface await `next` as a function Fixes: #335
1 parent 4bd26cd commit 5838e49

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/interfaces/koa.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ export function koaErrorHandler(client: RequestHandler, config: Configuration) {
4242
* @param {Function} next - the result of the request handlers to yield
4343
* @returns {Undefined} does not return anything
4444
*/
45-
return function*(this: {request: Request; response: Response;}, next: {}) {
45+
return function*(
46+
this: {request: Request; response: Response;}, next: Function) {
4647
const svc = config.getServiceContext();
4748

4849
try {
49-
yield next;
50+
yield next();
5051
} catch (err) {
5152
const em = new ErrorMessage()
5253
.consumeRequestInformation(koaRequestInformationExtractor(

0 commit comments

Comments
 (0)