#tanstack mutation onError doesnt handle convex error properly
12 messages · Page 1 of 1 (latest)
hey @burnt epoch i just figured that it works if i do it like this
kinda hoping that convex would automatically handle the type of the thrown error
i probably expecting to high lol
Say more, automatically handle how?
@random plume do you want to set a global handler and always toast or something?
im saying i dont want to add that ConvexErr type on the onError callback
or maybe im such a noob on error handling haha
Ah got it, actually careful since there are other errors you could get here too! ConvexErrors are the only ones that will have messages attached, but other built-in errors can throw here too and they're just normal errors. In dev they'll have stack traces and messages and all but in prod they're more like Error("server error")
so as not to leak information from the backend