Skip to content

Commit

Permalink
👷 update error code for retry logic (#1193)
Browse files Browse the repository at this point in the history
* update errod code

* update tests
  • Loading branch information
pankaj443 authored Mar 3, 2023
1 parent f5da400 commit 6b56353
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/client/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export class PercyClient {
}
});
} catch (error) {
if (error.message.includes('409')) {
if (error.message.includes('400')) {
return false;
}
throw error;
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ describe('PercyClient', () => {

it('returns false if tile is not verified', async () => {
api.reply('/comparisons/891011/tiles/verify', async () => {
return [409, 'Not found'];
return [400, 'failure'];
});

await expectAsync(client.uploadComparisonTiles(891011, [
Expand All @@ -997,7 +997,7 @@ describe('PercyClient', () => {

it('throws any errors from verifying', async () => {
api.reply('/comparisons/891011/tiles/verify', async () => {
return [400, 'failure'];
return [409, 'Not found'];
});

await expectAsync(client.uploadComparisonTiles(891011, [
Expand Down

0 comments on commit 6b56353

Please sign in to comment.