Handling error globally

MMugetsu11/8/2022
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.

        queryCache: new QueryCache({
          onError: async (error: any) => {
            console.log(error.id);
            console.log(error.message);
            console.log(error.code);
            console.log(error.data);
            console.log(error?.data?.httpStatus === 401);
            if (
              error?.data?.httpStatus === 401 ||
              error.message === "UNAUTHORIZED"
            ) {
              await signOut({ redirect: false });
            }
          },
        }),
UUUnknown User11/8/2022
Message Not Public
Sign In & Join Server To View
MMugetsu11/8/2022
>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
UUUnknown User11/8/2022
Message Not Public
Sign In & Join Server To View
MMugetsu11/9/2022
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)