diff --git a/src/providers/index.ts b/src/providers/index.ts index 682317d..1bf98ed 100644 --- a/src/providers/index.ts +++ b/src/providers/index.ts @@ -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 } }); diff --git a/test/e2e/proxy.test.ts b/test/e2e/proxy.test.ts index 4da6964..365dc16 100644 --- a/test/e2e/proxy.test.ts +++ b/test/e2e/proxy.test.ts @@ -19,7 +19,7 @@ describe('GET /ipfs/*', () => { ); expect(response.statusCode).toBe(400); - }); + }, 15e3); }); describe('when the IPFS cid does not exist', () => {