-
Notifications
You must be signed in to change notification settings - Fork 361
Fix backend error message details #2421
New issue
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
Fix backend error message details #2421
Conversation
🦋 Changeset detectedLatest commit: d98ed12 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
cc48c63
to
ff516a8
Compare
packages/backend/src/api/request.ts
Outdated
@@ -154,7 +154,7 @@ export function buildRequest(options: CreateBackendApiOptions) { | |||
data: deserialize(data), | |||
errors: null, | |||
}; | |||
} catch (err) { | |||
} catch (err: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} catch (err: any) { | |
} catch (err: unknown) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done on purpose. Since the result is passed to with withLegacyReturn
all type safety is gone here. I can fix the types as well but wanted to get the fix out quick.
6561462
to
6d3958e
Compare
This was caused by API errors beeing parsed twice. Once in the response error handling and again when initializing a new ClerkAPIResponseError.
6d3958e
to
d98ed12
Compare
@SokratisVidros I updated the fix a bit to make it simpler, also added a test for this case (its present in v5) |
Description
This was caused by API errors being parsed twice. Once in the response error handling code and again when initializing a new
ClerkAPIResponseError
.This is was fixed in v5 with the removal of
ClerkAPIResponseError
.ClerkAPIResponseError
is also used by clerk-js the change was to the backend package.Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change
Packages affected
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/clerk-expo
@clerk/fastify
gatsby-plugin-clerk
@clerk/localizations
@clerk/nextjs
@clerk/clerk-react
@clerk/remix
@clerk/clerk-sdk-node
@clerk/shared
@clerk/themes
@clerk/types
build/tooling/chore