catch errors in the graph thread