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 Jan 26, 2024
1 parent 18a5a58 commit 8db5a7a
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 8db5a7a

Please sign in to comment.