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

feat: πŸ§‘β€πŸ’» delegates raise PrismaClientKnownRequestError #1105

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

paulsouche
Copy link

This pull request covers some cases of the #1082

It is not perfect. It covers only P2025 error codes and the error messages are not the same than the prisma exceptions. As they have some legacy errors, I did not take this into consideration.

It introduces a breaking change on update as it will now raise an exception instead of returning null

That's a start. I will have a look if we can easily improve these error messages. Meanwhile, let me know what you think πŸ™

@thw0rted
Copy link

thw0rted commented Nov 8, 2024

@morintd could you please take a look at this? I believe it would fix a lot of tests that we currently have to skip because they expect the Prisma call to throw on missing records.

@paulsouche
Copy link
Author

@thw0rted have you seen my workaround in #1082 ?

@thw0rted
Copy link

thw0rted commented Nov 8, 2024

Yes, thanks @paulsouche -- I'm going to look at adding that, but after posting the above comment I realized that some of my findUniqueOrThrow calls do throw (just "new Error()", not the more-accurate version from this PR) while some return null instead of throwing. I haven't had a chance to investigate why this is. I probably need to figure out what's going on there first; if I'm actually hitting another bug I'll try to boil it down to a simple repro...

@paulsouche
Copy link
Author

Feel free to fork mine it's already setup

@thw0rted
Copy link

Thanks Paul, the error wound up being a misconfigured mock, but I did run into the other issue you describe here (update should throw instead of returning null), which I've filed here as #1163, using your starter.

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

Successfully merging this pull request may close these issues.

3 participants