Skip to content
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

chore: use handle-mongo-error utility to generate error string for Database error #614

Closed
tshuli opened this issue Nov 10, 2020 · 2 comments
Assignees
Labels

Comments

@tshuli
Copy link
Contributor

tshuli commented Nov 10, 2020

Extension of #602

@tshuli tshuli self-assigned this Nov 10, 2020
@r00dgirl r00dgirl added the P3 label Mar 18, 2021
@r00dgirl r00dgirl added this to the typescriptify backend milestone Mar 18, 2021
@liangyuanruo
Copy link
Contributor

Application code is using new DatabaseError(getMongoErrorMessage(error))

@karrui
Copy link
Contributor

karrui commented Mar 22, 2021

Not all, we should also return database errors with handle-mongo-error.ts#transformMongoError instead of getMongoErrorMessage too, for better error typings instead of just the message. Most of our code is still returning with

return new DatabaseError('some message')

instead of

return transformMongoError(error)

which can give more specific errors.

Probably not a priority though, as we usually do not discriminate between the various database errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants