Skip to content

Commit

Permalink
Improved error handler in Portal for the integrity token endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sagzy committed Jan 22, 2025
1 parent d0e37b8 commit 616afb6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/portal/src/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ function setupGhostApi({siteUrl = window.location.origin, apiUrl, apiKey}) {
if (res.ok) {
return res.text();
} else {
// Try to read body error message that is human readable and should be shown to the user
const humanError = await HumanReadableError.fromApiResponse(res);
if (humanError) {
throw humanError;
}
throw new Error('Failed to start a members session');
}
},
Expand Down

0 comments on commit 616afb6

Please sign in to comment.