Skip to content

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

Merged
zomars merged 5 commits intomainfrom
fix/update-or-throw
Aug 31, 2022
Merged

fix: update rejectOnNotFound -> find(Fist|Unique)OrThrow#3829
zomars merged 5 commits intomainfrom
fix/update-or-throw

Conversation

@agustif
Copy link
Copy Markdown
Contributor

@agustif agustif commented Aug 12, 2022

@vercel
Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

agustif commented Aug 12, 2022

@zomars this removes some custom HttpErrors, thoughts?

@agustif
Copy link
Copy Markdown
Contributor Author

agustif commented Aug 12, 2022

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

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
Contributor

@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