]> sigrok.org Git - pulseview.git/commitdiff
Session: Catch errors listing the config keys
authorJoel Holdsworth <redacted>
Mon, 6 Apr 2015 09:11:59 +0000 (10:11 +0100)
committerUwe Hermann <redacted>
Thu, 11 Jun 2015 18:38:47 +0000 (20:38 +0200)
pv/session.cpp

index d5126660f56b140d2337d64b1df625a4ea44b148..2cdc25f83ed0ee3c718896da9d8df98d13f34876 100644 (file)
@@ -400,7 +400,12 @@ shared_ptr<view::Signal> Session::signal_from_channel(
 void Session::read_sample_rate(shared_ptr<sigrok::Device> device)
 {
        assert(device);
-       const auto keys = device->config_keys(ConfigKey::DEVICE_OPTIONS);
+       map< const ConfigKey*, set<sigrok::Capability> > keys;
+
+       try {
+               keys = device->config_keys(ConfigKey::DEVICE_OPTIONS);
+       } catch (const Error) {}
+
        const auto iter = keys.find(ConfigKey::SAMPLERATE);
        cur_samplerate_ = (iter != keys.end() &&
                (*iter).second.find(sigrok::GET) != (*iter).second.end()) ?