]> sigrok.org Git - pulseview.git/commitdiff
Fix #1259 by not silently ignoring file read errors
authorSoeren Apel <redacted>
Wed, 15 Aug 2018 07:28:35 +0000 (09:28 +0200)
committerUwe Hermann <redacted>
Tue, 21 Aug 2018 10:02:38 +0000 (12:02 +0200)
pv/devices/inputfile.cpp

index 46886ed516399eaebb7b624edf951a70775b7b01..65331563937058e92d0716844f49088fc1760ee6 100644 (file)
@@ -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_);