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

fix: update rejectOnNotFound -> find(Fist|Unique)OrThrow #3829

Merged
merged 5 commits into from
Aug 31, 2022

Conversation

agustif
Copy link
Contributor

@agustif agustif commented Aug 12, 2022

@vercel
Copy link

vercel bot commented Aug 12, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ❌ Failed (Inspect) Aug 31, 2022 at 5:28PM (UTC)
1 Ignored Deployment
Name Status Preview Updated
swagger ⬜️ Ignored (Inspect) Aug 31, 2022 at 5:28PM (UTC)

@agustif
Copy link
Contributor Author

agustif commented Aug 12, 2022

@zomars this removes some custom HttpErrors, thoughts?

@agustif
Copy link
Contributor Author

agustif commented Aug 12, 2022

prisma/prisma#12159 I see you already did some digging here

Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this @agustif let's add a prisma not found error handler to defaultResponder as well 🙏🏽

@agustif
Copy link
Contributor Author

agustif commented Aug 31, 2022

Thanks for doing this Agusti Fernandez Pardo let's add a prisma not found error handler to defaultResponder as well 🙏🏽
@zomars is this what you meant?
Added on getServerErrorFromUnknown.ts

  if (cause instanceof NotFoundError) {
    return new HttpError({ statusCode: 404, message: cause.message, cause });
  }

Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Computer Reaction GIF by GitHub

@zomars zomars merged commit 58c4c89 into main Aug 31, 2022
@zomars zomars deleted the fix/update-or-throw branch August 31, 2022 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants