Skip to content

Commit

Permalink
call response hook on handled cases
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 2, 2023
1 parent 1df8f02 commit f147e2d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ export function createAppEventHandler(stack: Stack, options: AppOptions) {

// Already handled
if (event.handled) {
if (options.onResponse) {
await options.onResponse(event, val);
}
return;
}
}
Expand All @@ -166,6 +169,10 @@ export function createAppEventHandler(stack: Stack, options: AppOptions) {
statusMessage: `Cannot find any path matching ${event.path || "/"}.`,
});
}

if (options.onResponse) {
await options.onResponse(event, undefined);
}

Check warning on line 175 in src/app.ts

View check run for this annotation

Codecov / codecov/patch

src/app.ts#L172-L175

Added lines #L172 - L175 were not covered by tests
});
}

Expand Down

0 comments on commit f147e2d

Please sign in to comment.