Catch errors for graph.