We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d9a986 commit fb758efCopy full SHA for fb758ef
packages/core/src/core/pardon.ts
@@ -499,7 +499,7 @@ export const PardonFetchExecution = pardonExecution({
499
function why(error: unknown) {
500
const reasons: string[] = [];
501
502
- while (typeof error?.["cause"] === "object") {
+ while (error?.["cause"] !== undefined) {
503
reasons.unshift(String(error?.["message"] ?? error));
504
error = error["cause"];
505
}
@@ -510,7 +510,7 @@ function why(error: unknown) {
510
return reasons.join("\n - ");
511
512
513
- return error;
+ return error?.["message"] ?? error;
514
515
516
function cleanRequestValues(request: Record<string, unknown>) {
0 commit comments