{"record":{"id":"f7db794117fd00d9","repo":"jackwener/OpenCLI","slug":"not-found-f7db79","errorCode":"NOT_FOUND","errorMessage":"Gitee user \"${username}\" does not exist","messagePattern":"Gitee user \"(.+?)\" does not exist","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"warning","filePath":"clis/gitee/user.js","lineNumber":168,"sourceCode":"          blocked,\n          nickname,\n          followers,\n          publicRepos,\n          giteeIndex,\n        };\n      })()\n    `);\n        const domSnapshotRecord = asRecord(rawDomSnapshot);\n        const domSnapshot = {\n            notFound: domSnapshotRecord?.notFound === true,\n            blocked: domSnapshotRecord?.blocked === true,\n            nickname: firstText(domSnapshotRecord?.nickname),\n            followers: normalizeCount(domSnapshotRecord?.followers),\n            publicRepos: normalizeCount(domSnapshotRecord?.publicRepos),\n            giteeIndex: normalizeCount(domSnapshotRecord?.giteeIndex),\n        };\n        if (domSnapshot.notFound) {\n            throw new CliError('NOT_FOUND', `Gitee user \"${username}\" does not exist`, 'Check the username and retry: opencli gitee user <username>');\n        }\n        if (domSnapshot.blocked) {\n            throw new CliError('FORBIDDEN', `Gitee user page \"${username}\" is not accessible`, 'The profile may be private/restricted, or the account may be unavailable');\n        }\n        const apiUrl = `${GITEE_USER_API}/${encodeURIComponent(username)}`;\n        const apiResponse = await fetch(apiUrl, {\n            headers: {\n                Accept: 'application/json',\n                'User-Agent': 'Mozilla/5.0',\n                Referer: profileUrl,\n            },\n        });\n        if (apiResponse.status === 404) {\n            throw new CliError('NOT_FOUND', `Gitee user \"${username}\" does not exist`, 'Check the username and retry: opencli gitee user <username>');\n        }\n        if (!apiResponse.ok) {\n            throw new CliError('REQUEST_FAILED', `Failed to read Gitee user profile API: ${apiResponse.status}`, 'Try again later or verify network access to gitee.com');\n        }","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/gitee/user.js#L150-L186","documentation":"CliError with code NOT_FOUND thrown when the scraped Gitee profile DOM snapshot reports notFound — the profile page rendered Gitee's 404/not-found state, meaning the username has no Gitee account. The library checks this flag right after normalizing snapshot fields and before calling the user API.","triggerScenarios":"page.goto(`${GITEE_BASE_URL}/${username}`) loads a profile page whose DOM snapshot contains notFound: true (Gitee 404 page), typically for a nonexistent or deleted account, or a mistyped/har-to-sanitize username.","commonSituations":"Typos in the username; account deleted or renamed; querying an email or display name instead of the login handle; case/underscore variations that don't exist; org namespace mistaken for a user path.","solutions":["Verify the username on gitee.com (e.g. https://gitee.com/<username>) and fix typos","Use the exact login handle, not display name or email","Retry per the hint: opencli gitee user <username> with the corrected value","Handle code NOT_FOUND in scripts to skip missing users instead of aborting a batch"],"exampleFix":"// before\nopencli gitee user jonh-doe   # NOT_FOUND\n// after\nopencli gitee user john-doe   # existing handle -> profile fields returned","handlingStrategy":"try-catch","validationCode":"// Optional pre-check that the profile exists\nconst check = await fetch(`https://gitee.com/${encodeURIComponent(username)}`);\nif (check.status === 404) {\n  console.error(`Gitee user \"${username}\" does not exist`);\n  process.exit(1);\n}","typeGuard":"function isNotFoundCode(e) {\n  return e instanceof Error && e.code === 'NOT_FOUND';\n}","tryCatchPattern":"try {\n  profile = await giteeUser(username);\n} catch (e) {\n  if (e.code === 'NOT_FOUND') {\n    console.error(`User \"${username}\" not found — check the handle and retry`);\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Verify usernames on gitee.com before batch lookups","Use exact login handles, not display names or emails","Skip-and-log NOT_FOUND users in bulk scripts instead of aborting","Watch for renamed/deleted accounts in recurring jobs"],"tags":["not-found","gitee","user-profile","scraping"],"backgroundTag":"resource-not-found-404","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}