diff --git a/src/headers/Yerbacon.hpp b/src/headers/Yerbacon.hpp index 568c534..a7d56a5 100644 --- a/src/headers/Yerbacon.hpp +++ b/src/headers/Yerbacon.hpp @@ -40,7 +40,9 @@ namespace Yerbacon { [[nodiscard]] const char* what() const noexcept final { return exceptionCause.data(); } - explicit Exception(const std::string_view& cause): exceptionCause(cause) {} + explicit Exception(const std::string_view& cause): exceptionCause(cause) { + if (!cause.ends_with('\n')) exceptionCause += '\n'; + } Exception(const std::string_view& cause, unsigned long line): Exception(('L' + std::to_string(line) + ": ").append(cause)) {} }; } diff --git a/src/main.cpp b/src/main.cpp index 361f78f..f6a24a8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,11 +68,10 @@ int main(int argc, char* argv[]) { for_each(Units.begin(), Units.end(), [&printResult](future>>& currentFuture) { const auto&& result = currentFuture.get(); if (not result.second.has_value()) { - if (printResult) cout << result.first; + if (printResult) cout << result.first << '\n'; } else { - cout << "Compilation of " << result.first << " has failed with the following error:\n" << result.second.value().what(); + cout << "Compilation of " << result.first << " has failed with the following error:\n" << result.second.value().what() << '\n'; } - cout << "\n\n"; }); } else cout << "No valid file provided.\n"; return EXIT_SUCCESS;