X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevices%2Finputfile.cpp;h=65331563937058e92d0716844f49088fc1760ee6;hp=8e973f0561718d33fcd58afbc40659696e41417a;hb=ea50cdfc65698ca314c84fe0f18604509d52ff78;hpb=1325ce422f1b49ab1f693125105b8c373c2965e5 diff --git a/pv/devices/inputfile.cpp b/pv/devices/inputfile.cpp index 8e973f0..6533156 100644 --- a/pv/devices/inputfile.cpp +++ b/pv/devices/inputfile.cpp @@ -86,7 +86,7 @@ InputFile::InputFile(const shared_ptr &context, settings.endGroup(); } - } catch (out_of_range) { + } catch (out_of_range&) { qWarning() << "Could not find input format" << format_name << "needed to restore session input 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_);