diff --git a/eslint.config.mjs b/eslint.config.mjs index bc0e5eba..727b4d4c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -78,6 +78,7 @@ export default [ "@typescript-eslint/no-unsafe-assignment": "off", "@typescript-eslint/no-unsafe-member-access": "off", "@typescript-eslint/no-unsafe-enum-comparison": "off", + "@typescript-eslint/prefer-promise-reject-errors": "off", "@typescript-eslint/no-unnecessary-type-assertion": "off", }, }, diff --git a/src/utils/helper.ts b/src/utils/helper.ts index 1b7c80e1..6cadbd49 100644 --- a/src/utils/helper.ts +++ b/src/utils/helper.ts @@ -11,7 +11,6 @@ import { SubmarinePairTypeTaproot, } from "./boltzClient"; import { ECPair } from "./ecpair"; -import { formatError } from "./errors"; import { ChainSwap, ReverseSwap, SomeSwap, SubmarineSwap } from "./swapCreator"; export const isIos = () => @@ -95,7 +94,7 @@ export const fetcher = async ( const apiUrl = getApiUrl() + url; const response = await fetch(apiUrl, opts); if (!response.ok) { - return Promise.reject(new Error(formatError(response))); + return Promise.reject(response); } return (await response.json()) as T; }; diff --git a/src/utils/http.ts b/src/utils/http.ts index 4863e37e..dc7cfd4d 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -1,8 +1,6 @@ -import { formatError } from "./errors"; - export const checkResponse = (response: Response): Promise => { if (!response.ok) { - return Promise.reject(new Error(formatError(response))); + return Promise.reject(response); } return response.json(); };