diff --git a/writer/StreamWriter.cpp b/writer/StreamWriter.cpp index 806a8662..8a079e0f 100644 --- a/writer/StreamWriter.cpp +++ b/writer/StreamWriter.cpp @@ -78,7 +78,13 @@ void StreamWriter::ProcessStartMessage() { image_puller_output.cbor->start_message->number_of_images); state = StreamWriterState::Started; NotifyTcpAck(TCPFrameType::START, true, false, TCPAckCode::None); - } catch (const JFJochException &e) { + } catch (const std::exception &e) { + // std::exception, not JFJochException: everything below this point - the error state, err, + // and above all the fatal ACK - is skipped if the exception escapes, and the broker is + // blocked on that ACK with the detector about to be armed. It would read the silence as a + // dead writer and report a timeout in place of the reason. Not every thrower here is ours: + // std::filesystem::exists throws filesystem_error when the output path cannot be walked, + // and SetupFinalizedFileSocket throws ZeroMQ's own type. logger.ErrorException(e); logger.Error("Error writing start message - switching to error state"); state = StreamWriterState::Error;