From: Soeren Apel Date: Tue, 6 Jun 2017 17:46:00 +0000 (+0200) Subject: Fix #775 by catching and handling the thrown exception X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=commitdiff_plain;h=dc4ada2bfd5d9f4386661ffbf7ff3ad000b6bfb5 Fix #775 by catching and handling the thrown exception --- diff --git a/pv/session.cpp b/pv/session.cpp index eec1a05..c18f809 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -849,7 +849,14 @@ void Session::sample_thread_proc(function error_handler) set_capture_state(device_->session()->trigger() ? AwaitingTrigger : Running); - device_->run(); + try { + device_->run(); + } catch (Error e) { + error_handler(e.what()); + set_capture_state(Stopped); + return; + } + set_capture_state(Stopped); // Confirm that SR_DF_END was received