Skip to content

Commit 059bbed

Browse files
committed
Fix ThreadedNode segfault
1 parent 3c1b2c1 commit 059bbed

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/pipeline/ThreadedNode.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,21 @@ void ThreadedNode::start() {
1212
try {
1313
run();
1414
} catch(const MessageQueue::QueueException& ex) {
15-
// catch anything and stop the node
16-
logger->info("Node closing: {}", ex.what());
15+
// catch the exception and stop the node
16+
auto expStr = fmt::format("Node stopped with a queue exception: {}", ex.what());
17+
if(logger) {
18+
logger->info(expStr);
19+
} else {
20+
spdlog::info(expStr);
21+
}
1722
running = false;
1823
} catch(const std::runtime_error& ex) {
19-
logger->error("Node threw exception, stopping the node. Exception message: {}", ex.what());
24+
auto expStr = fmt::format("Node threw exception, stopping the node. Exception message: {}", ex.what());
25+
if(logger) {
26+
logger->error(expStr);
27+
} else {
28+
spdlog::error(expStr);
29+
}
2030
running = false;
2131
}
2232
});

0 commit comments

Comments
 (0)