Open matannahmani opened 1 year ago
I would suggest adding an option to override errorResponseObject with your own error object
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello,
Any news on this topic ?
I'm having a use case where I try to add some data to a 409 error (the conflicting object). I cannot find a way to return anything attached to the error.
unfortunately,they hard code the condition,while zodError occur,force set message as ‘Input validation failed’
we can just change “error.caus.name” to break the condition.
I had tried it works!
@aagwali
is there even a reason to limit the shape of the response body? I think that's the purpose of the trpc errorFormatter that we're all using, I think trpc-openapi should just take the error object as it is and pass it on...
I've been using errorFormatter to include Zod errors and more custom errors, but the returned error type in openapi schema doesn't synchronize trpc error formatter:
return open-api schema:
real response: