22 "Cannot wrap a success error - check for success before calling wrap()");
24 std::optional<std::error_code> EC;
25 std::vector<std::string> Messages;
27 llvm::handleAllErrors(std::move(E), [&](
const llvm::ErrorInfoBase &EI) {
30 EC = EI.convertToErrorCode();
33 std::string ErrorMsg = EI.message();
34 if (!ErrorMsg.empty())
35 Messages.push_back(std::move(ErrorMsg));
38 assert(EC &&
"wrap() called with a non-success error but no handler fired - "
39 "indicates a bug in handleAllErrors");
41 ErrorBuilder Builder(*EC);