Skip to content

Commit

Permalink
Rename ex → err in catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
fflorent committed Sep 20, 2024
1 parent 36a814d commit 8985a91
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/server/lib/scim/v2/ScimUserController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@ class ScimUserController {
try {
this._checkAccess(context);
return await cb();
} catch (ex) {
if (ex instanceof ApiError) {
if (ex.status === 409) {
throw new SCIMMY.Types.Error(ex.status, 'uniqueness', ex.message);
} catch (err) {
if (err instanceof ApiError) {
if (err.status === 409) {
throw new SCIMMY.Types.Error(err.status, 'uniqueness', err.message);
}
throw new SCIMMY.Types.Error(ex.status, null!, ex.message);
throw new SCIMMY.Types.Error(err.status, null!, err.message);
}
if (ex instanceof SCIMMY.Types.Error) {
throw ex;
if (err instanceof SCIMMY.Types.Error) {
throw err;
}
// By default, return a 500 error
throw new SCIMMY.Types.Error(500, null!, ex.message);
throw new SCIMMY.Types.Error(500, null!, err.message);
}
}

Expand Down

0 comments on commit 8985a91

Please sign in to comment.