Put this before your if statement in the catch block.
console.log(e instanceof TRPCClientError)
If this is true, then that means you will never run the code in your if statement.
@asheeshh try checking the type of your error. You may need to do an if check against TRPC error first and then throw a new error based on what you're experiencing.