Exit with code only if code is present