Better RPC error handling