[frontend] Handle when program exits with error.