Skip to content

Commit

Permalink
chore: temporarily write better error log in withSecured
Browse files Browse the repository at this point in the history
  • Loading branch information
brunotot committed Aug 17, 2024
1 parent 2879289 commit 146b4c6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ export function withSecured(...roles: KeycloakRole[]): RequestHandler[] {
}

next();
} catch (error) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
if (!error.content) {
res.status(500).send({ error });
}
const typedError = error as ErrorResponse;
const content = typedError.content;
res.status(content.status).send(content);
Expand Down

0 comments on commit 146b4c6

Please sign in to comment.