mirror of
https://github.com/logto-io/logto.git
synced 2025-03-10 22:22:45 -05:00
chore: add comments
This commit is contained in:
parent
9e67b670de
commit
614375589d
1 changed files with 4 additions and 0 deletions
|
@ -350,6 +350,10 @@ export default function logtoConfigRoutes<T extends AuthedRouter>(
|
|||
},
|
||||
});
|
||||
} catch (error: unknown) {
|
||||
/**
|
||||
* `ResponseError` comes from `@withtyped/client` and all `logto/core` API returns error in the
|
||||
* format of `RequestError`, we manually transform it here to keep the error format consistent.
|
||||
*/
|
||||
if (error instanceof ResponseError) {
|
||||
const { message } = z.object({ message: z.string() }).parse(await error.response.json());
|
||||
throw new RequestError({ code: 'jwt_customizer.general', status: 422 }, { message });
|
||||
|
|
Loading…
Add table
Reference in a new issue