{"record":{"id":"da7c7a3ad52cf332","repo":"ramensoftware/windhawk","slug":"internal","errorCode":"INTERNAL","errorMessage":"e instanceof Error ? e.message : String(e)","messagePattern":"e instanceof Error \\? e\\.message : String\\(e\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/windhawk-vscode/src/extension.ts","lineNumber":544,"sourceCode":"\t\tmodId: string\n\t): Promise<InstalledModProfileFields & { error?: WireError }> {\n\t\ttry {\n\t\t\tconst entry = await this._utils.core.getInstalledModDetails({\n\t\t\t\tmodId,\n\t\t\t\tlanguage: this._language,\n\t\t\t\tcheckForUpdates: this._checkForUpdates,\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tlatestVersion: entry.latestVersion,\n\t\t\t\tuserRating: entry.userRating\n\t\t\t};\n\t\t} catch (e) {\n\t\t\treportException(e);\n\t\t\treturn {\n\t\t\t\tlatestVersion: null,\n\t\t\t\tuserRating: 0,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'INTERNAL',\n\t\t\t\t\tmessage: e instanceof Error ? e.message : String(e)\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\tprivate readonly _handleMessageMap: Record<string, (message: any) => void | Promise<void>> = {\n\t\tgetInitialAppSettings: async message => {\n\t\t\tlet appUISettings: Partial<AppUISettings> = {};\n\t\t\ttry {\n\t\t\t\tconst appSettings = await this._utils.core.getAppSettings();\n\t\t\t\tthis._language = appSettings.language;\n\t\t\t\tthis._checkForUpdates = !appSettings.disableUpdateCheck;\n\t\t\t\tthis._alwaysCompileModsLocally = appSettings.alwaysCompileModsLocally;\n\n\t\t\t\tappUISettings = await this._getAppUISettings(appSettings);\n\t\t\t} catch (e) {\n\t\t\t\treportException(e);","sourceCodeStart":526,"sourceCodeEnd":562,"githubUrl":"https://github.com/ramensoftware/windhawk/blob/61d99ed8e182e1af1b60109612b6763ad1b4b74e/src/windhawk-vscode/src/extension.ts#L526-L562","documentation":"Generic internal catch-all in _installedModProfileFields (windhawk-vscode extension). Any exception thrown while computing a mod's profile fields (latest version, user rating) is reported via reportException and converted to an error object with code INTERNAL carrying the exception's message.","triggerScenarios":"Any unexpected exception in _installedModProfileFields — e.g. network/HTTP failure while fetching latest version or user rating, or malformed response data — inside the try block.","commonSituations":"Offline or flaky network when resolving the latest version; API changes upstream; unhandled promise rejections from helpers used by the profile-fields routine.","solutions":["Read the message string in the error object and reportException output to find the underlying exception.","Check network connectivity / API availability for the latest-version or rating endpoints.","Add targeted error handling for the failing sub-call instead of relying on the INTERNAL catch-all."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!navigator.onLine) {\n  console.warn('Offline: mod profile fields may be unavailable');\n}","typeGuard":"function toErrorMessage(e: unknown): string {\n  return e instanceof Error ? e.message : String(e);\n}","tryCatchPattern":"try {\n  const fields = await getInstalledModProfileFields(modId);\n  if (fields.error) {\n    console.warn(`Profile fields unavailable (${fields.error.code}): ${fields.error.message}`);\n    return { latestVersion: null, userRating: 0 };\n  }\n} catch (e) {\n  console.error(toErrorMessage(e));\n}","preventionTips":["Check network/API availability before fetching profile fields and degrade gracefully.","Log the raw exception (reportException output) so INTERNAL messages are diagnosable.","Pin/wrap remote calls so transient HTTP failures become typed errors rather than reaching the INTERNAL catch-all."],"tags":["internal","unhandled-exception","vscode-extension"],"backgroundTag":"api-request-failed","analyzedSha":"61d99ed8e182e1af1b60109612b6763ad1b4b74e","analyzedAt":"2026-09-12T14:02:41.115Z","contentChangedAt":"2026-09-12T14:02:41.115Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}