{"record":{"id":"0a126b49c728f9a6","repo":"badges/shields","slug":"collection-not-found","errorCode":null,"errorMessage":"collection not found","messagePattern":"collection not found","errorType":"exception","errorClass":"NotFound","httpStatus":null,"severity":"warning","filePath":"services/steam/steam-workshop.service.js","lineNumber":147,"sourceCode":"\n  static version = '1'\n\n  async handle({ collectionId }) {\n    const options = {\n      method: 'POST',\n      form: {\n        collectioncount: '1',\n        'publishedfileids[0]': collectionId,\n      },\n    }\n\n    const json = await this.fetch({\n      schema: collectionFoundOrNotSchema,\n      options,\n    })\n\n    if (json.response.collectiondetails[0].result) {\n      throw new NotFound({ prettyMessage: 'collection not found' })\n    }\n\n    return this.constructor.render({\n      size: json.response.collectiondetails[0].children.length,\n    })\n  }\n}\n\nclass SteamFileService extends BaseSteamAPI {\n  static interf = 'ISteamRemoteStorage'\n\n  static method = 'GetPublishedFileDetails'\n\n  static version = '1'\n\n  async onRequest({ response }) {\n    throw new Error(`onRequest() wasn't implemented for ${this.name}`)\n  }","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/steam/steam-workshop.service.js#L129-L165","documentation":"The Steam Workshop collection badge queries the Steam ISteamRemoteStorage/GetCollectionDetails API and validates with collectionFoundOrNotSchema. If `response.collectiondetails[0].result` is set (Steam returns a non-zero result code meaning the lookup failed), `handle` throws NotFound 'collection not found'.","triggerScenarios":"Calling /steam/collection with an `id` that is not a published Workshop collection, is private, has been deleted, or is a Workshop item of a different app whose collectiondetails come back with a failure result code.","commonSituations":"Copying an item ID (workshop file) instead of a collection ID; collection made private/removed after the badge was embedded; wrong appId/namespace so Steam can't resolve the ID.","solutions":["Verify the collection ID from the Workshop collection URL (id= query param) and that it is public","Confirm the id is a collection, not a single Workshop file (use the file badge for items)","Check the collection still exists and wasn't deleted or made friends-only","Re-test via the Steam Workshop page in an incognito browser; if it 404s there the badge will too"],"exampleFix":"// before\n/badge/steam/collection/12345   // this is a single item id\n// after\n/badge/steam/collection/67890   // actual published collection id","handlingStrategy":"try-catch","validationCode":"const res = await fetch(`https://steamcommunity.com/sharedfiles/filedetails/?id=${collectionId}`);\nif (!res.ok || (await res.text()).includes('Error')) throw new Error('collection not publicly accessible');","typeGuard":"const isValidCollectionId = (id) => typeof id === 'string' && /^\\d{6,}$/.test(id);","tryCatchPattern":"try {\n  return await steamCollectionSize({ id: collectionId });\n} catch (err) {\n  if (err prettyMessage === 'collection not found') {\n    // render 'collection unavailable' badge and verify the id on the Workshop\n  } else throw err;\n}","preventionTips":["Copy collection ids directly from the Workshop collection URL","Verify the id is a collection, not a single Workshop file","Re-check periodically that embedded collections remain public and undeleted"],"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"}