projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
73078ef
)
Fix #1259 by not silently ignoring file read errors
author
Soeren Apel
<soeren@apelpie.net>
Wed, 15 Aug 2018 07:28:35 +0000
(09:28 +0200)
committer
Uwe Hermann
<uwe@hermann-uwe.de>
Tue, 21 Aug 2018 10:02:38 +0000
(12:02 +0200)
pv/devices/inputfile.cpp
patch
|
blob
|
history
diff --git
a/pv/devices/inputfile.cpp
b/pv/devices/inputfile.cpp
index 46886ed516399eaebb7b624edf951a70775b7b01..65331563937058e92d0716844f49088fc1760ee6 100644
(file)
--- 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_);