ParseArguments (#227414, LLVM 24 cycle, not released yet) is the first pass-plugin hook whose result is an llvm::Error created inside the plugin and handled by the host. opt and llc forward it to reportFatalUsageError, LTO clients will return it from LTO::run(). I'd like to settle how that should work before 24 branches, because llvm::Error identifies types by address.
ErrorInfoBase::classID() is &ID, a static char per subclass, and isA chains pointer comparisons. That is fine for plugins that resolve llvm:: symbols from the host, which is every plugin in tree. It breaks for a self-contained plugin with its own statically linked, symbol-hidden copy of LLVM (we build one that implements a full backend this way). Its StringError carries the plugin's IDs, so on the host side report_fatal_error(Error) → logAllUnhandledErrors → handleAllErrors fails even the ErrorInfoBase catch-