{"record":{"id":"355da0cd31ddab17","repo":"badges/shields","slug":"not-specified","errorCode":null,"errorMessage":"not specified","messagePattern":"not specified","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"info","filePath":"services/aur/aur.service.js","lineNumber":78,"sourceCode":"  static openApi = {\n    '/aur/license/{packageName}': {\n      get: {\n        summary: 'AUR License',\n        description: 'Arch linux User Repository License',\n        parameters: pathParams({\n          name: 'packageName',\n          example: 'android-studio',\n        }),\n      },\n    },\n  }\n\n  static defaultBadgeData = { label: 'license' }\n\n  transform(json) {\n    const licenses = json.results[0].License\n    if (!licenses || licenses.length === 0) {\n      throw new NotFound({ prettyMessage: 'not specified' })\n    }\n\n    return { licenses }\n  }\n\n  async handle({ packageName }) {\n    const json = await this.fetch({ packageName })\n    const { licenses } = this.transform(json)\n    return renderLicenseBadge({ licenses, color: 'blue' })\n  }\n}\n\nclass AurVotes extends BaseAurService {\n  static category = 'rating'\n\n  static route = { base: 'aur/votes', pattern: ':packageName' }\n\n  static openApi = {","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/aur/aur.service.js#L60-L96","documentation":"The AUR license badge reads the License field of the first result. If the package has no license metadata in the AUR (field missing, null, or an empty array), transform throws NotFound with 'not specified' so the badge shows that the license is unspecified upstream, distinguishing it from a network or schema failure.","triggerScenarios":"Calling the AUR license badge for a package whose AUR metadata has no License entry: json.results[0].License is undefined or an empty array, so transform throws NotFound({ prettyMessage: 'not specified' }).","commonSituations":"AUR packages created without a license field in the PKGBUILD; packages where the maintainer never filled in license metadata even though the software has a license; very old or abandoned AUR packages.","solutions":["Check the package's AUR page and add or fix the license field in the PKGBUILD if you maintain it.","If you are the consumer and the license truly is unspecified, accept the 'not specified' badge as the correct output.","Fall back to the upstream repository's license badge if the AUR metadata is incomplete."],"exampleFix":"// before (PKGBUILD)\n# license not declared\n// after (PKGBUILD)\nlicense=('MIT')","handlingStrategy":"fallback","validationCode":"const data = await fetchAurInfo(pkg)\nconst licenses = data.results?.[0]?.License\nif (!licenses || licenses.length === 0) console.warn(`No license metadata for ${pkg}`)","typeGuard":"function hasLicense(r) {\n  return Array.isArray(r?.License) && r.License.length > 0\n}","tryCatchPattern":"try {\n  return await getAurLicense(pkg)\n} catch (e) {\n  if (/not specified/.test(e.message)) return 'license unspecified'\n  throw e\n}","preventionTips":["Always declare license in AUR PKGBUILDs you maintain","Cross-check the upstream repo license when AUR metadata is empty","Treat 'not specified' as data, not a failure, when rendering"],"tags":["aur","license","not-found","metadata"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}