Skip to content

Commit cf3d57e

Browse files
committed
Log errors in APIs
1 parent 30413a3 commit cf3d57e

File tree

1 file changed

+12
-8
lines changed
  • packages/functions/src/common

1 file changed

+12
-8
lines changed

packages/functions/src/common/api.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ export const handleSuccessfulResponse = ({ body }: { body: unknown }) => ( {
1111
headers: commonResponseHeaders,
1212
});
1313

14-
export const handleResponseError = ({ error }: { error: unknown }) => ({
15-
statusCode: StatusCodes.INTERNAL_SERVER_ERROR,
16-
body: {
17-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
18-
error,
19-
},
20-
headers: commonResponseHeaders,
21-
});
14+
export const handleResponseError = ({ error }: { error: unknown }) => {
15+
console.log('Error', error);
16+
17+
return {
18+
statusCode: StatusCodes.INTERNAL_SERVER_ERROR,
19+
body: {
20+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
21+
error,
22+
},
23+
headers: commonResponseHeaders,
24+
};
25+
};

0 commit comments

Comments
 (0)