{"record":{"id":"26e3c3531fd5175b","repo":"badges/shields","slug":"file-not-found","errorCode":null,"errorMessage":"file not found","messagePattern":"file not found","errorType":"exception","errorClass":"NotFound","httpStatus":null,"severity":"warning","filePath":"services/steam/steam-workshop.service.js","lineNumber":179,"sourceCode":"  static version = '1'\n\n  async onRequest({ response }) {\n    throw new Error(`onRequest() wasn't implemented for ${this.name}`)\n  }\n\n  async handle({ fileId }) {\n    const options = {\n      method: 'POST',\n      form: {\n        itemcount: 1,\n        'publishedfileids[0]': fileId,\n      },\n    }\n\n    const json = await this.fetch({ schema: fileFoundOrNotSchema, options })\n\n    if (json.response.publishedfiledetails[0].result) {\n      throw new NotFound({ prettyMessage: 'file not found' })\n    }\n\n    return this.onRequest({ response: json.response.publishedfiledetails[0] })\n  }\n}\n\nclass SteamFileSize extends SteamFileService {\n  static category = 'size'\n\n  static route = {\n    base: 'steam/size',\n    pattern: ':fileId',\n  }\n\n  static openApi = {\n    '/steam/size/{fileId}': {\n      get: {\n        summary: 'Steam File Size',","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/steam/steam-workshop.service.js#L161-L197","documentation":"The Steam Workshop file size badge calls GetPublishedFileDetails and validates with fileFoundOrNotSchema. A truthy `response.publishedfiledetails[0].result` indicates Steam could not resolve the published file, so `handle` throws NotFound 'file not found'.","triggerScenarios":"Calling /steam/workshop/size (or related file badges) with a Workshop file `id` that was deleted, is private, doesn't exist, or belongs to a different game than the one in the URL.","commonSituations":"Typo or truncation of the long Workshop item ID; item hidden by the author or removed by moderators; embedding badges for items on private servers/mods.","solutions":["Copy the id directly from the item's Workshop URL (?id=NNNN) to avoid transcription errors","Confirm the item is publicly visible on the Workshop in an incognito session","Ensure the correct game/app path segment matches the item's app","If recently deleted/re-uploaded, use the new item's id"],"exampleFix":"// before\n/badge/steam/workshop/size/1234\n// after (full Workshop file id)\n/badge/steam/workshop/size/2512345678","handlingStrategy":"try-catch","validationCode":"const res = await fetch(`https://steamcommunity.com/sharedfiles/filedetails/?id=${fileId}`);\nif (!res.ok) throw new Error(`workshop item ${fileId} not publicly visible`);","typeGuard":"const isValidWorkshopFileId = (id) => typeof id === 'string' && /^\\d{9,}$/.test(id);","tryCatchPattern":"try {\n  return await steamWorkshopSize({ id: fileId });\n} catch (err) {\n  if (err prettyMessage === 'file not found') {\n    // render 'item not found' badge; prompt maintainer to update the id\n  } else throw err;\n}","preventionTips":["Use the full numeric id from the item's Workshop URL (?id=NNNN), no truncation","Confirm the item is public in an incognito browser before embedding","Keep the game/app segment consistent with the item's app"],"tags":["steam","workshop","not-found","third-party-api"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}