Skip to content

Commit

Permalink
Refactor log method in Error.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryKogan committed Dec 31, 2023
1 parent ee1f814 commit 51dd29b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/FileSystem/Error/Error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ class Error { // NOLINT (bugprone-exception-escape)
trace.push_back(*this);
return trace;
}
auto log(std::ostream &out_stream, bool verbose = true) const -> void {
if (verbose) {
for (auto const &error : trace()) { out_stream << " " << error.what() << '\n'; }
} else {
out_stream << what() << '\n';
}
auto log(std::ostream &out_stream) const -> void {
for (auto const &error : trace()) { out_stream << " " << error.what() << '\n'; }
}

auto wrap(const Error &error) -> Error & {
Expand Down

0 comments on commit 51dd29b

Please sign in to comment.