Exit with error code if error.