Skip to content

Commit

Permalink
fix: fix capture condition (#176)
Browse files Browse the repository at this point in the history
* fix: fix capture condition

* chore: fix tests by increasing timeout
  • Loading branch information
wa0x6e authored Sep 7, 2023
1 parent 0062d62 commit 80d84a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ export default function uploadToProviders(providers: string[], type: ProviderTyp
return result;
} catch (e: any) {
if (e instanceof Error) {
capture(e, { name });
} else if (e?.message !== 'Request timed out') {
if (e.message !== 'Request timed out') {
capture(e, { name });
}
} else {
capture(new Error(`Error from ${name} provider`), {
contexts: { provider_response: e }
});
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/proxy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('GET /ipfs/*', () => {
);

expect(response.statusCode).toBe(400);
});
}, 15e3);
});

describe('when the IPFS cid does not exist', () => {
Expand Down

0 comments on commit 80d84a7

Please sign in to comment.