Catch exception by value
parent
1bc479fc3c
commit
b9f080456c
|
@ -29,7 +29,7 @@ void FileWriter::emit(bool add_header, bool force_overwrite) const {
|
|||
bool file_exists = true;
|
||||
try {
|
||||
existing_contents = file_contents(filename_.c_str(), add_header);
|
||||
} catch (CantOpenFile) {
|
||||
} catch (const CantOpenFile& e) {
|
||||
file_exists = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue