@gearbox-protocol/sdk 10.7.0 → 10.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -184,12 +184,18 @@ const retryCodes = /* @__PURE__ */ new Set([
|
|
|
184
184
|
const defaultShouldRetry = ({
|
|
185
185
|
error
|
|
186
186
|
}) => {
|
|
187
|
-
if (error instanceof import_viem.CallExecutionError && error.details === "header not found") {
|
|
188
|
-
return true;
|
|
189
|
-
}
|
|
190
187
|
if ("code" in error && typeof error.code === "number") {
|
|
191
188
|
return retryCodes.has(error.code);
|
|
192
189
|
}
|
|
190
|
+
const msg = error.message?.toLowerCase() ?? `${error}`.toLowerCase();
|
|
191
|
+
if ([
|
|
192
|
+
"unknown block",
|
|
193
|
+
"header not found",
|
|
194
|
+
"resource unavailable",
|
|
195
|
+
"requested resource not available"
|
|
196
|
+
].some((s) => msg.includes(s))) {
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
193
199
|
return false;
|
|
194
200
|
};
|
|
195
201
|
class AbstractTransportSelector {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseError,
|
|
3
|
-
CallExecutionError,
|
|
4
3
|
HttpRequestError,
|
|
5
4
|
http,
|
|
6
5
|
InvalidInputRpcError,
|
|
@@ -172,12 +171,18 @@ const retryCodes = /* @__PURE__ */ new Set([
|
|
|
172
171
|
const defaultShouldRetry = ({
|
|
173
172
|
error
|
|
174
173
|
}) => {
|
|
175
|
-
if (error instanceof CallExecutionError && error.details === "header not found") {
|
|
176
|
-
return true;
|
|
177
|
-
}
|
|
178
174
|
if ("code" in error && typeof error.code === "number") {
|
|
179
175
|
return retryCodes.has(error.code);
|
|
180
176
|
}
|
|
177
|
+
const msg = error.message?.toLowerCase() ?? `${error}`.toLowerCase();
|
|
178
|
+
if ([
|
|
179
|
+
"unknown block",
|
|
180
|
+
"header not found",
|
|
181
|
+
"resource unavailable",
|
|
182
|
+
"requested resource not available"
|
|
183
|
+
].some((s) => msg.includes(s))) {
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
181
186
|
return false;
|
|
182
187
|
};
|
|
183
188
|
class AbstractTransportSelector {
|