X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fstoresession.cpp;h=182642ee9aba08757269c43e208cf3b7147d5ef5;hp=809dba3e6694e37da736e6799e2deaa946e69d18;hb=f9319755734823208210b1e244b827ecb6820346;hpb=56c4de9ada023505b16b6d188fb77d9fb10e52e1 diff --git a/pv/storesession.cpp b/pv/storesession.cpp index 809dba3e..182642ee 100644 --- a/pv/storesession.cpp +++ b/pv/storesession.cpp @@ -45,7 +45,6 @@ using std::mutex; using std::pair; using std::shared_ptr; using std::string; -using std::unordered_set; using std::vector; using Glib::VariantBase; @@ -302,10 +301,14 @@ void StoreSession::store_proc(vector< shared_ptr > achannel_li units_stored_ = unit_count_ - (sample_count_ >> progress_scale); } - auto dfend = context->create_end_packet(); - const string ldata_str = output_->receive(dfend); - if (output_stream_.is_open()) - output_stream_ << ldata_str; + try { + auto dfend = context->create_end_packet(); + const string ldata_str = output_->receive(dfend); + if (output_stream_.is_open()) + output_stream_ << ldata_str; + } catch (Error& error) { + error_ = tr("Error while saving: ") + error.what(); + } // Zeroing the progress variables indicates completion units_stored_ = unit_count_ = 0;