[Serialization|NFC] Intro diagnoseAndConsumeError

Intro the service `diagnoseAndConsumeError` as the ultimate site to drop
deserialization issues we can recover from. It will be used to raise
diagnostics on the issues before dropping them silently.
This commit is contained in:
Alexis Laferrière
2023-05-18 14:16:30 -07:00
parent e0014b4ed7
commit a475f4c132
3 changed files with 40 additions and 31 deletions

View File

@@ -418,6 +418,10 @@ public:
/// error is returned.
llvm::Error consumeExpectedError(llvm::Error &&error);
/// Report project errors as remarks if desired, otherwise drop the error
/// silently.
void diagnoseAndConsumeError(llvm::Error error) const;
/// Report an unexpected format error that could happen only from a
/// memory-level inconsistency. Please prefer passing an error to
/// `fatal(llvm::Error error)` when possible.