From: Soeren Apel Date: Wed, 15 Aug 2018 07:28:35 +0000 (+0200) Subject: Fix #1259 by not silently ignoring file read errors X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ea50cdfc65698ca314c84fe0f18604509d52ff78;p=pulseview.git Fix #1259 by not silently ignoring file read errors --- diff --git a/pv/devices/inputfile.cpp b/pv/devices/inputfile.cpp index 46886ed5..65331563 100644 --- a/pv/devices/inputfile.cpp +++ b/pv/devices/inputfile.cpp @@ -133,15 +133,16 @@ void InputFile::open() f->read(buffer.data(), BufferSize); const streamsize size = f->gcount(); + if (size == 0) - return; + throw QString("Failed to read file"); input_->send(buffer.data(), size); try { device_ = input_->device(); - } catch (sigrok::Error&) { - return; + } catch (sigrok::Error& e) { + throw e; } session_->add_device(device_);