Skip to content

Commit

Permalink
refactor: use readable error code
Browse files Browse the repository at this point in the history
  • Loading branch information
zyoshoka committed Oct 12, 2024
1 parent 8ec3a66 commit 1a3ed18
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/backend/test-federation/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function signin(
})
.then(({ id, i }) => ({ id, i }))
.catch(async err => {
if (err.id === '22d05606-fbcf-421a-a2db-b32610dcfd1b') {
if (err.code === 'TOO_MANY_AUTHENTICATION_FAILURES') {
await sleep(Math.random() * 2000);
return await signin(host, params);
}
Expand Down Expand Up @@ -96,8 +96,6 @@ export async function fetchAdmin(host: Host): Promise<LoginUser> {
if (err.id === '6cc579cc-885d-43d8-95c2-b8c7fc963280') {
await createAdmin(host);
return await signin(host, ADMIN_PARAMS);
} else if (err.id === '22d05606-fbcf-421a-a2db-b32610dcfd1b') {
return await signin(host, ADMIN_PARAMS);
}
throw err;
});
Expand Down

0 comments on commit 1a3ed18

Please sign in to comment.