From f9890e47dac5284e3e686247f1bebb4e02f3080c Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 12 Nov 2021 09:57:32 +0100 Subject: [PATCH] Image pattern generator: fixed NL in exception explanation string Standard exceptions (eg. from stol) doesn't have newlines in what() so do not pass it with custom ones but print it in the handler. --- src/utils/video_pattern_generator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/video_pattern_generator.cpp b/src/utils/video_pattern_generator.cpp index 2ba0cee28..3a9a965a5 100644 --- a/src/utils/video_pattern_generator.cpp +++ b/src/utils/video_pattern_generator.cpp @@ -314,7 +314,7 @@ class image_pattern_raw : public image_pattern { public: explicit image_pattern_raw(string config) { if (config.empty()) { - throw ug_runtime_error("Empty raw pattern is not allowed!\n"); + throw ug_runtime_error("Empty raw pattern is not allowed!"); } while (!config.empty()) { unsigned char byte = 0; @@ -398,7 +398,7 @@ unique_ptr image_pattern::create(string const &config) { LOG(LOG_LEVEL_ERROR) << MOD_NAME << "Wrong color!\n"; } } - throw ug_runtime_error("Unknown pattern: "s + config + "!\n"s); + throw ug_runtime_error("Unknown pattern: "s + config + "!"s); } static void testcard_fillRect(struct testcard_pixmap *s, struct testcard_rect *r, uint32_t color) @@ -425,7 +425,7 @@ video_pattern_generate(std::string const & config, int width, int height, codec_ try { generator = image_pattern::create(config); } catch (exception const &e) { - LOG(LOG_LEVEL_ERROR) << MOD_NAME << e.what(); + LOG(LOG_LEVEL_ERROR) << MOD_NAME << e.what() << "\n"; return {nullptr, free_deleter}; } if (!generator) {