From 868b387d9a60efa7a5f175b22467c5ec20060305 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Sun, 26 Aug 2018 03:31:09 +0000 Subject: [PATCH] Fixed C++ worker program due to changing exceptions from string to object (related to commit 4ca232b94998). --- cpp/QrCodeGeneratorWorker.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/QrCodeGeneratorWorker.cpp b/cpp/QrCodeGeneratorWorker.cpp index 2e14607..b4669ba 100644 --- a/cpp/QrCodeGeneratorWorker.cpp +++ b/cpp/QrCodeGeneratorWorker.cpp @@ -91,9 +91,9 @@ int main() { std::cout << (qr.getModule(x, y) ? 1 : 0) << std::endl; } - } catch (const char *msg) { - if (strcmp(msg, "Data too long") != 0) { - std::cerr << msg << std::endl; + } catch (const std::length_error &ex) { + if (strcmp(ex.what(), "Data too long") != 0) { + std::cerr << ex.what() << std::endl; return EXIT_FAILURE; } std::cout << -1 << std::endl;