{"record":{"id":"ee57750195279a79","repo":"badges/shields","slug":"version-not-found-ee5775","errorCode":null,"errorMessage":"version not found","messagePattern":"version not found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/luarocks/luarocks.service.js","lineNumber":68,"sourceCode":"      schema,\n      httpErrors: {\n        404: 'user not found',\n      },\n    })\n    const moduleData = repository[moduleName]\n    if (!moduleData) {\n      throw new NotFound({ prettyMessage: 'module not found' })\n    }\n    return moduleData\n  }\n\n  async handle({ user, moduleName, version: requestedVersion }) {\n    const moduleInfo = await this.fetch({ user, moduleName })\n\n    let version\n    if (requestedVersion) {\n      if (!(requestedVersion in moduleInfo)) {\n        throw new NotFound({ prettyMessage: 'version not found' })\n      }\n      version = requestedVersion\n    } else {\n      const versions = Object.keys(moduleInfo)\n      version = latestVersion(versions)\n    }\n    return renderVersionBadge({ version })\n  }\n}\n","sourceCodeStart":50,"sourceCodeEnd":78,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/luarocks/luarocks.service.js#L50-L78","documentation":"After fetching module info, handle() resolves which version to report. If the URL specifies a requestedVersion and that version key is not present in the module's version map, it throws NotFound('version not found'). Without a requested version, the latest is chosen instead and this error cannot occur.","triggerScenarios":"Requesting a LuaRocks badge pinned to a version string that does not exist for the module, e.g. /luarocks/v/user/module/1.2.3 where 1.2.3 was never released or was deleted.","commonSituations":"Stale documentation or READMEs referencing old versions, typos in the version string, or the rock author having removed that version from LuaRocks.","solutions":["Check the module's version list on luarocks.org and use an existing version string.","Remove the version segment from the badge URL to report the latest version.","Update the version in the URL if the project released a newer version."],"exampleFix":"// before\n/luarocks/v/user/module/0.9.0.svg  // 0.9.0 deleted\n// after\n/luarocks/v/user/module/1.0.0.svg","handlingStrategy":"validation","validationCode":"const versions = Object.keys(await luarocksService.fetch({ user, moduleName }))\nif (requestedVersion && !versions.includes(requestedVersion)) throw new Error(`Version ${requestedVersion} not published`)","typeGuard":"const hasVersion = (moduleInfo, v) => moduleInfo != null && Object.prototype.hasOwnProperty.call(moduleInfo, v)","tryCatchPattern":"try {\n  return await luarocksService.handle({ user, moduleName, version })\n} catch (e) {\n  if (e instanceof NotFound && e.prettyMessage === 'version not found') {\n    // fall back to latest-version badge or show 'unknown version'\n  }\n  throw e\n}","preventionTips":["Pin versions only after confirming them on the rock's luarocks.org page.","Prefer version-less badges (latest) for long-lived READMEs to avoid staleness.","Update pinned versions when bumping dependencies in your project."],"tags":["luarocks","not-found","versioning"],"backgroundTag":"version-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}