Skip to content

Commit 519f4f5

Browse files
authored
Pass through API error messages when bridging (#297)
1 parent c97263d commit 519f4f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main/api/chainport/vendor/requests.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ const makeChainportRequest = async <T extends object>(
8585
})
8686
.catch((error) => {
8787
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
88-
const chainportError = error.response?.data?.error?.description as string;
89-
if (chainportError) {
90-
throw new Error(chainportError);
88+
const apiError = error.response?.data?.message as string;
89+
if (apiError) {
90+
throw new Error("Chainport error: " + apiError);
9191
} else {
92-
throw new Error("Chainport error - " + error);
92+
throw new Error("Chainport error: " + error);
9393
}
9494
});
9595

0 commit comments

Comments
 (0)