Add catch-all error handling to run()

@danchia PTAL