We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to send data to the Events API with an unauthorized token returns Failed to parse JSON as the error code as res.json() throws an error.
Failed to parse JSON
res.json()
Using an unauthorized token to throw Unauthorized as the error message rather than Failed to parse JSON as it can be misleading
Unauthorized
I feel like adding:
if (res.status === 403) { throw new Error("Unauthorized"); }
to the fetch function on client.ts would solve the issue
fetch
client.ts
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Current behaviour
Trying to send data to the Events API with an unauthorized token returns
Failed to parse JSON
as the error code asres.json()
throws an error.Desired behaviour
Using an unauthorized token to throw
Unauthorized
as the error message rather thanFailed to parse JSON
as it can be misleadingI feel like adding:
to the
fetch
function onclient.ts
would solve the issueThe text was updated successfully, but these errors were encountered: