File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,21 @@ void ThreadedNode::start() {
12
12
try {
13
13
run ();
14
14
} 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
+ }
17
22
running = false ;
18
23
} 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
+ }
20
30
running = false ;
21
31
}
22
32
});
You can’t perform that action at this time.
0 commit comments