{"record":{"id":"f46445c1c77e3732","repo":"badges/shields","slug":"requirement-not-found","errorCode":null,"errorMessage":"requirement not found","messagePattern":"requirement not found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/galaxytoolshed/galaxytoolshed-version.service.js","lineNumber":84,"sourceCode":"          },\n        ),\n      },\n    },\n  }\n\n  static transform({ response, tool, requirement }) {\n    if (tool !== undefined) {\n      const dataTool = response[1].valid_tools.find(x => x.id === tool)\n      if (dataTool === undefined) {\n        throw new NotFound({ prettyMessage: 'tool not found' })\n      }\n      // Requirement version\n      if (requirement !== undefined) {\n        const dataRequirement = dataTool.requirements.find(\n          x => x.name === requirement,\n        )\n        if (dataRequirement === undefined) {\n          throw new NotFound({ prettyMessage: 'requirement not found' })\n        }\n        return dataRequirement.version\n      }\n      // Tool version\n      return dataTool.version\n    }\n    // Repository version\n    return response[1].changeset_revision\n  }\n\n  async handle({ repository, owner, tool, requirement }) {\n    const response = await this.fetchLastOrderedInstallableRevisionsSchema({\n      repository,\n      owner,\n    })\n    const version = this.constructor.transform({\n      response,\n      tool,","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/galaxytoolshed/galaxytoolshed-version.service.js#L66-L102","documentation":"Thrown in GalaxyToolshedVersionService.transform when a requirement name is requested but the matched tool's requirements array contains no entry whose name equals the :requirement parameter. The service looks up dataTool.requirements for the given name to report its version.","triggerScenarios":"Calling the version badge with a requirement name that the tool's requirements list does not define, e.g. /galaxytoolshed/version/{repo}/{owner}/{tool}/{requirement} where requirement is misspelled or not a declared requirement of that tool.","commonSituations":"Requirement names differing in spelling or punctuation (e.g. 'samtools' vs 'sam-tools'); requesting a requirement that was added only in newer revisions; confusing requirement names with tool ids.","solutions":["Inspect the tool's requirements in its tool_dependencies.xml or the Tool Shed UI to get exact names","Use the exact requirement name as declared in the repository metadata","If unsure, drop the requirement segment to get the plain tool version instead"],"exampleFix":"// before\n/galaxytoolshed/version/repo/owner/bowtie2/samtool\n// after\n/galaxytoolshed/version/repo/owner/bowtie2/samtools","handlingStrategy":"validation","validationCode":"const reqs = toolInfo?.requirements ?? [];if (!reqs.some(r => r.name === requirementName)) { console.warn(`${requirementName} is not a requirement of this tool`); }","typeGuard":"const hasRequirement = (tool, name) => Array.isArray(tool?.requirements) && tool.requirements.some(r => r?.name === name);","tryCatchPattern":"try { return await versionBadge({ repo, owner, tool, requirement }); } catch (e) { if (String(e.message).includes('requirement not found')) { return versionBadge({ repo, owner, tool }); } throw e; }","preventionTips":["Match requirement names exactly as declared in the repository metadata","Fall back to the plain tool-version badge when unsure of requirement names","Confirm the target revision still declares the requirement"],"tags":["galaxytoolshed","not-found","requirement"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}