client: propagate exception during early op. setup

This commit is contained in:
Michael Davidsaver
2023-09-07 14:35:52 +02:00
parent f20d958c46
commit 68cc69b984
3 changed files with 34 additions and 9 deletions
+11 -3
View File
@@ -857,10 +857,18 @@ std::shared_ptr<Subscription> MonitorBuilder::exec()
context->tcp_loop.dispatch([op, context, server]() {
// on worker
op->chan = Channel::build(context, op->channelName, server);
try {
op->chan = Channel::build(context, op->channelName, server);
op->chan->pending.push_back(op);
op->chan->createOperations();
op->chan->pending.push_back(op);
op->chan->createOperations();
}catch(...){
// nothing else has happened, so the queue will be empty
assert(op->queue.empty());
op->queue.emplace_back();
op->queue.back().exc = std::current_exception();
op->doNotify();
}
});
return external;