fix(ipc): Avoid clearing module content

Refs #324
This commit is contained in:
Michael Carlberg 2017-01-13 05:33:33 +01:00
parent 184a1c5281
commit 8d355f8255

View File

@ -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) {