Handle RPC errors