Skip to content

Commit

Permalink
catch exceptions caused by threading to prevent crashing UI (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas authored Apr 4, 2018
1 parent 013475c commit 946bd20
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/rqt_dep/ros_pack_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import division
from __future__ import print_function
import os
import pickle
import sys

import rospkg

Expand Down Expand Up @@ -273,7 +275,12 @@ def _refresh_rospackgraph(self, force_update=False):

# this runs in a non-gui thread, so don't access widgets here directly
def _update_thread_run(self):
self._update_graph(self._generate_dotcode())
try:
dotcode = self._generate_dotcode()
except Exception as e:
print(str(type(e)), str(e), file=sys.stderr)
return
self._update_graph(dotcode)

@Slot()
def _update_finished(self):
Expand Down

0 comments on commit 946bd20

Please sign in to comment.