[PATCH] D67407: All Errors must be checked

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 16:16:38 PDT 2019


lhames added a comment.

I think you need to consume Result here instead of joining it:

  if (auto Err = SerializationTraits<ChannelT, Error, Error>::deserialize(C, Result)) {
    consumeError(std::move(Result));
    return std::move(Err);
  }

In the first check deserialization has failed, so Result doesn't contain a meaningful Error value (it's probably still success, but it would depend on how the deserializer was written). In the second check you //could// return Result (since it has been fully deserialized) but for symmetry with other values I think you just want to consume it and return the RPC failure: that's what we do everywhere else.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67407/new/

https://reviews.llvm.org/D67407





More information about the llvm-commits mailing list