Skip to content

Commit

Permalink
WebAuthn: add cause to JS errors
Browse files Browse the repository at this point in the history
Fixes #38400
  • Loading branch information
FroMage committed Mar 20, 2024
1 parent e08da06 commit 19b4ae6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
if (res.status === 200) {
return res;
}
throw new Error(res.statusText);
throw new Error(res.statusText, {cause: res});
})
.then(res => res.json())
.then(res => {
Expand Down Expand Up @@ -167,7 +167,7 @@
if (res.status >= 200 && res.status < 300) {
return res;
}
throw new Error(res.statusText);
throw new Error(res.statusText, {cause: res});
});
};

Expand All @@ -188,7 +188,7 @@
if (res.status >= 200 && res.status < 300) {
return res;
}
throw new Error(res.statusText);
throw new Error(res.statusText, {cause: res});
});
};

Expand All @@ -209,7 +209,7 @@
if (res.status === 200) {
return res;
}
throw new Error(res.statusText);
throw new Error(res.statusText, {cause: res});
})
.then(res => res.json())
.then(res => {
Expand Down

0 comments on commit 19b4ae6

Please sign in to comment.