Write all error messages (if any) in E to a string. The newline character is used to separate error messages.
| 984 | /// Write all error messages (if any) in E to a string. The newline character |
| 985 | /// is used to separate error messages. |
| 986 | inline std::string toString(Error E) { |
| 987 | SmallVector<std::string, 2> Errors; |
| 988 | handleAllErrors(std::move(E), [&Errors](const ErrorInfoBase &EI) { |
| 989 | Errors.push_back(EI.message()); |
| 990 | }); |
| 991 | return join(Errors.begin(), Errors.end(), "\n"); |
| 992 | } |
| 993 | |
| 994 | /// Consume a Error without doing anything. This method should be used |
| 995 | /// only where an error can be considered a reasonable and expected return |