This does the similar for error messages as D52952 has done for warnings.
With llvm::lto::LTO, the error might appear when LTO::run() is executed. In that case, the calling code cannot know which module causes the error and, subsequently, cannot hint the user.