vercel-api-js 2.9.2 → 2.9.3
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.
- package/dist/effect.cjs +6 -2
- package/dist/effect.mjs +6 -2
- package/package.json +1 -1
package/dist/effect.cjs
CHANGED
|
@@ -81,6 +81,10 @@ function convertError(error) {
|
|
|
81
81
|
cause: error
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
+
// The vercel-api-js fetcher rejects with this message when the caller's onResponse throws.
|
|
85
|
+
function isResponseHookError(error) {
|
|
86
|
+
return error instanceof Error && error.message.startsWith("onResponse threw on ");
|
|
87
|
+
}
|
|
84
88
|
// ============================================================================
|
|
85
89
|
// Proxy Factories
|
|
86
90
|
// ============================================================================
|
|
@@ -98,8 +102,8 @@ function toEffect(op) {
|
|
|
98
102
|
signal
|
|
99
103
|
}
|
|
100
104
|
}),
|
|
101
|
-
catch:
|
|
102
|
-
});
|
|
105
|
+
catch: (error)=>error
|
|
106
|
+
}).pipe(effect.Effect.catch((error)=>isResponseHookError(error) ? effect.Effect.die(error) : effect.Effect.fail(convertError(error))));
|
|
103
107
|
});
|
|
104
108
|
}
|
|
105
109
|
function createEffectApi(operationsByTag) {
|
package/dist/effect.mjs
CHANGED
|
@@ -79,6 +79,10 @@ function convertError(error) {
|
|
|
79
79
|
cause: error
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
+
// The vercel-api-js fetcher rejects with this message when the caller's onResponse throws.
|
|
83
|
+
function isResponseHookError(error) {
|
|
84
|
+
return error instanceof Error && error.message.startsWith("onResponse threw on ");
|
|
85
|
+
}
|
|
82
86
|
// ============================================================================
|
|
83
87
|
// Proxy Factories
|
|
84
88
|
// ============================================================================
|
|
@@ -96,8 +100,8 @@ function toEffect(op) {
|
|
|
96
100
|
signal
|
|
97
101
|
}
|
|
98
102
|
}),
|
|
99
|
-
catch:
|
|
100
|
-
});
|
|
103
|
+
catch: (error)=>error
|
|
104
|
+
}).pipe(Effect.catch((error)=>isResponseHookError(error) ? Effect.die(error) : Effect.fail(convertError(error))));
|
|
101
105
|
});
|
|
102
106
|
}
|
|
103
107
|
function createEffectApi(operationsByTag) {
|