Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ Client: End of Barrage stream should throw; reformat exception messages #5682

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void UpdateProcessor::RunUntilCancelled(std::shared_ptr<UpdateProcessor> self) {
try {
self->RunForeverHelper();
} catch (...) {
// If the thread was been cancelled via explicit user action, then swallow all errors.
// If the thread has been cancelled via explicit user action, then swallow all errors.
if (!self->cancelled_) {
self->callback_->OnFailure(std::current_exception());
}
Expand All @@ -228,6 +228,11 @@ void UpdateProcessor::RunForeverHelper() {
while (true) {
auto chunk = fsr_->Next();
OkOrThrow(DEEPHAVEN_LOCATION_EXPR(chunk));
if (chunk->data == nullptr) {
// Stream ended. This is abnormal for Deephaven.
const char *message = "Unexpected end of stream";
throw std::runtime_error(DEEPHAVEN_LOCATION_STR(message));
}
const auto &cols = chunk->data->columns();
auto column_sources = MakeReservedVector<std::shared_ptr<ColumnSource>>(cols.size());
auto sizes = MakeReservedVector<size_t>(cols.size());
Expand Down
2 changes: 1 addition & 1 deletion cpp-client/deephaven/dhcore/src/utility/utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void TrueOrThrowHelper(const DebugInfo &debug_info) {

std::string FormatDebugString(const char *func, const char *file, size_t line,
const std::string &message) {
return fmt::format("{}@{}:{}: {}", func, file, line, message);
return fmt::format("{}: {}@{}:{}", message, func, file, line);
}

std::string GetWhat(std::exception_ptr eptr) {
Expand Down
Loading