Skip to content

Commit

Permalink
fix: capture formatted provider error as contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Sep 6, 2023
1 parent ae3b626 commit 87fb035
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export default function uploadToProviders(providers: string[], type: ProviderTyp

return result;
} catch (e: any) {
capture(e, { name });
if (e instanceof Error) {
capture(e, { name });
} else {
capture('Error from provider', { contexts: { input: { name }, provider_response: e } });
}
return Promise.reject(e);
} finally {
end({ status });
Expand Down

0 comments on commit 87fb035

Please sign in to comment.