devoxa/prisma-relay-cursor-connection

Handling Exception when Query Error in Callback Functions

sombochea opened this issue · 2 comments

Hi, team

I wonder about the function findManyCursorConnection that doesn't support handling outside the try catch block that I want to use with custom exception handling when the user passes any malformed query to the backend. Here is an example of my statement that not working with try catch below:

image

Thank you!

Hey, are you sure the error is throw inside of the try clause and not outside? We do something very similar and it works fine for us for malformed queries.

Hey, are you sure the error is throw inside of the try clause and not outside? We do something very similar and it works fine for us for malformed queries.

Ohh, it's my bad! I'm applied GlobalFilters with PrismaClientExceptionFilter in main app configuration. So, if I throws other exception class without PrismaClientException, it's work well. Thank you!

image

image