From 8d355f825528491f94038411eb220f9e421d19c5 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 13 Jan 2017 05:33:33 +0100 Subject: [PATCH] fix(ipc): Avoid clearing module content Refs #324 --- src/modules/ipc.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/ipc.cpp b/src/modules/ipc.cpp index c4dce368..7d9fe6af 100644 --- a/src/modules/ipc.cpp +++ b/src/modules/ipc.cpp @@ -107,11 +107,15 @@ namespace modules { match = true; m_log.info("%s: Found matching hook (%s)", name(), hook->payload); - m_output.clear(); - auto command = command_util::make_command(hook->command); - command->exec(false); - command->tail([this](string line) { m_output = line; }); + try { + auto command = command_util::make_command(hook->command); + command->exec(false); + command->tail([this](string line) { m_output = line; }); + } catch (const exception& err) { + m_log.err("%s: Failed to execute hook command (err: %s)", err.what()); + m_output.clear(); + } } if (match) {