fix: do not throw errors from sendError

This commit is contained in:
Evan Tschannen 2021-10-20 22:05:00 -07:00
parent e34d242581
commit e3cd6f8b6f
1 changed files with 5 additions and 6 deletions

View File

@ -441,13 +441,12 @@ public:
template <class E>
void sendError(const E& exc) const {
if (queue->isRemoteEndpoint() && !queue->sentError) {
if (queue->acknowledgements.failures.isError()) {
throw queue->acknowledgements.failures.getError();
if (queue->isRemoteEndpoint()) {
if (!queue->sentError && !queue->acknowledgements.failures.isError()) {
queue->sentError = true;
FlowTransport::transport().sendUnreliable(
SerializeSource<ErrorOr<EnsureTable<T>>>(exc), getEndpoint(), false);
}
queue->sentError = true;
FlowTransport::transport().sendUnreliable(
SerializeSource<ErrorOr<EnsureTable<T>>>(exc), getEndpoint(), false);
} else {
queue->sendError(exc);
if (errors && errors->canBeSet()) {