From f0deea173179296927f4b461d19e985109d74813 Mon Sep 17 00:00:00 2001 From: Lauris Kaplinski Date: Mon, 12 Aug 2024 17:20:43 +0300 Subject: [PATCH] Send meaningful json and exit directly if invalid argument is encountered in stdin mode --- src/controller/controller.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/controller/controller.cpp b/src/controller/controller.cpp index 4bbbd9f7..8dc74273 100644 --- a/src/controller/controller.cpp +++ b/src/controller/controller.cpp @@ -108,6 +108,9 @@ void Controller::run() // Command parameter is only used if exception will be raised during json creation writeResponseToStdOut(isInStdinMode, {{QStringLiteral("invalid-argument"), exc.what()}}, "invalid-argument"); + // Exit directly here + disposeUI(); + exit(); } onCriticalFailure(exc.what()); } catch (const std::exception& error) {