Skip to content

Commit

Permalink
fix: 1inch diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
doomsower committed Oct 16, 2023
1 parent b394fbe commit 9383ecb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/services/swap/oneInch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { ClientRequest } from "node:http";

import type { NetworkType } from "@gearbox-protocol/sdk";
import {
CHAINS,
Expand Down Expand Up @@ -90,13 +88,12 @@ export default class OneInch extends BaseSwapper implements ISwapper {
);
} catch (e) {
let info: any;
let url: string | undefined;
if (axios.isAxiosError(e)) {
info = e.response?.data;
url = (e.request as ClientRequest)?.req?.url;
info = JSON.stringify(e.response?.data);
}
info = info || `${e}`;
this.log.error(
`Failed to swap ${amnt} ${tokenSymbolByAddress[tokenAddr]} back to ETH via ${url}: ${e} ${info}`,
`Failed to swap ${amnt} ${tokenSymbolByAddress[tokenAddr]} back to ETH via: ${info}`,
);
}
}
Expand Down

0 comments on commit 9383ecb

Please sign in to comment.