How can i check if an error is a TRPC Error in the browser?
Solution
It is often useful to access the types of your API within your clients. For this purpose, you are able to infer the types contained in your AppRouter.
error.message // NOT_FOUND (throwing this intentionally - i'd like to build a react error boundary that has specific handling for TRPC Errors like NOT_FOUND)
Object.getPrototypeOf(error) // default "Error" object/class
error instanceof TRPCClientError // false. this would have been my best bet.