We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 02832ca + 360202a commit 0aabe69Copy full SHA for 0aabe69
packages/express-wrapper/src/response.ts
@@ -38,13 +38,12 @@ export const defaultResponseEncoder: ResponseEncoder = (
38
return;
39
}
40
const responseCodec = route.response[status];
41
- if (responseCodec === undefined || !responseCodec.is(payload)) {
+ try {
42
+ expressRes.status(status).json(responseCodec!.encode(payload)).end();
43
+ } catch {
44
console.warn(
45
"Unable to encode route's return value, did you return the expected type?",
46
);
47
expressRes.status(500).end();
- return;
48
-
49
- expressRes.status(status).json(responseCodec.encode(payload)).end();
50
};
0 commit comments