Check exit code to handle cancels