[PATCH] D27440: clang-format-vsix: fail when clang-format outputs to stderr

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 19 01:36:02 PST 2016


ioeric added a comment.

`llvm::ErrorOr` carries `std::error_code`. If you want richer information (e.g. error_code + error message), `llvm::Expcted<T>` and `llvm::Error` are your friends.

FYI, if you only need error_code + error_message in the returned error, there is also `llvm::StringError`. And if you want to carry even more information in the errors, you can implement `llvm::ErrorInfo`, which is what we are doing in libTooling replacements library: https://github.com/llvm-mirror/clang/blob/master/include/clang/Tooling/Core/Replacement.h#L150


https://reviews.llvm.org/D27440





More information about the cfe-commits mailing list