forked from OSchip/llvm-project
Handle "file not found" error in the superclass's errStr().
If a subclass does not override the member function, the superclass's method takes care of string conversion of "file not found" error. This is a reasonable default behavior. Subclasses are still able to override to customize error messages. llvm-svn: 191058
This commit is contained in:
parent
f7ec86a55b
commit
388fbd8f31
|
@ -226,7 +226,9 @@ public:
|
|||
}
|
||||
|
||||
/// \brief create an error string for printing purposes
|
||||
virtual std::string errStr(llvm::error_code) {
|
||||
virtual std::string errStr(llvm::error_code errc) {
|
||||
if (errc == llvm::errc::no_such_file_or_directory)
|
||||
return (Twine("Cannot open ") + _path).str();
|
||||
llvm_unreachable("not handling errors");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue