Use onError to change an application error into a TRPCError?
I want to use the onError handler to change any instance of a custom application error into a TRPCError (I want the HTTP Status code to be a 401 rather than a 500). I tried this but it doesn't work...
nor does this
I can set individual properties on the error object like error.message but thought there might be an easier way. Has anybody got a nifty hack for this?
nor does this
I can set individual properties on the error object like error.message but thought there might be an easier way. Has anybody got a nifty hack for this?