Jack Fischer
Jack Fischer8mo ago

Modify mutation error messages?

We occasionally get timeouts from cloudfront which gives the user an error about how the cloudfront HTML error page isn't valid JSON, instead of what would make sense to the user, which is that the request timed out. Is there a callback or anything else anywhere we could use to intercede on error messages?
2 Replies
Jack Fischer
Jack Fischer8mo ago
Ah I think I answered my own question,
trpcNext.createNextApiHandler({
onError: ...
})
trpcNext.createNextApiHandler({
onError: ...
})
Hmm, this actually doesn't seem to let you modify the error, just take some external action with it
Nick
Nick8mo ago
It's interesting that a failed request would try to be parsed at all by the frontend, maybe worth raising a github issue about this with some extra detail