From ea50cdfc65698ca314c84fe0f18604509d52ff78 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Wed, 15 Aug 2018 09:28:35 +0200 Subject: [PATCH] Fix #1259 by not silently ignoring file read errors --- pv/devices/inputfile.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pv/devices/inputfile.cpp b/pv/devices/inputfile.cpp index 46886ed..6533156 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_); -- 2.30.2