uvd-x402-sdk 2.52.0 → 2.52.1

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.
@@ -2995,6 +2995,19 @@ var Erc8004Client = class {
2995
2995
  clearTimeout(timeoutId);
2996
2996
  if (!response.ok) {
2997
2997
  const errorText = await response.text();
2998
+ try {
2999
+ const parsed = JSON.parse(errorText);
3000
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
3001
+ return {
3002
+ ...parsed,
3003
+ // Never let a 4xx body claim success, whatever it says.
3004
+ success: false,
3005
+ error: parsed.error ?? `Facilitator error: ${response.status}`,
3006
+ network: parsed.network ?? request.network
3007
+ };
3008
+ }
3009
+ } catch {
3010
+ }
2998
3011
  return {
2999
3012
  success: false,
3000
3013
  error: `Facilitator error: ${response.status} - ${errorText}`,