Handling error globally
According to the docs on errors https://trpc.io/docs/v10/error-handling I should get such error object on client side when its thrown from procedure If I understand correctly. But Im having a problem with it as it doesnt seem to be typed as TRPCError on the client and dont contain few props from described in docs.
4 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
>All errors that occur in a procedure go through the onError method before being sent to the client
I care about the part which lands on the client. Does it mean I cant get proper typings and all information regarding the error on the client? Or Am I doing something worng
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Its not in my desire to define onerror for every query/mutation I make. I want a global error handler of 401 but I wonder why some info is missing from onError in QueryCache(global handler)