Skip to content

Commit

Permalink
utl: Simplify error mesage in stream handler.
Browse files Browse the repository at this point in the history
Remove "basic_ios::clear: iostream error" error and ":iostream error"
suffix that does not say much so the message is more user friendly.

Signed-off-by: Christian Costa <[email protected]>
  • Loading branch information
titan73 committed Nov 11, 2024
1 parent e6917a7 commit a96b134
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utl/src/ScopedTemporaryFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ StreamHandler::StreamHandler(const char* filename, bool binary)
try {
os_.open(tmp_filename_, mode);
} catch (std::ios_base::failure& e) {
std::string error = e.what();
std::throw_with_nested(std::ios_base::failure(error + " (failed to open '"
+ tmp_filename_ + "')"));
std::throw_with_nested(std::runtime_error("Failed to open '" + tmp_filename_
+ "' for writing"));
}
}

Expand Down

0 comments on commit a96b134

Please sign in to comment.