{"record":{"id":"de7cc1390286e442","repo":"badges/shields","slug":"no-public-receiving-stats","errorCode":null,"errorMessage":"no public receiving stats","messagePattern":"no public receiving stats","errorType":"exception","errorClass":"InvalidResponse","httpStatus":null,"severity":"warning","filePath":"services/liberapay/liberapay-receives.service.js","lineNumber":28,"sourceCode":"        summary: 'Liberapay receiving',\n        parameters: pathParams({\n          name: 'entity',\n          example: 'Changaco',\n        }),\n      },\n    },\n  }\n\n  async handle({ entity }) {\n    const data = await this.fetch({ entity })\n    if (data.receiving) {\n      return renderCurrencyBadge({\n        label: 'receives',\n        amount: data.receiving.amount,\n        currency: data.receiving.currency,\n      })\n    } else {\n      throw new InvalidResponse({ prettyMessage: 'no public receiving stats' })\n    }\n  }\n}\n","sourceCodeStart":10,"sourceCodeEnd":32,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/liberapay/liberapay-receives.service.js#L10-L32","documentation":"The Liberapay receiving badge throws InvalidResponse when the API response lacks public receiving statistics (`data.receiving` absent or incomplete). Mirrors the giving badge: Liberapay lets users hide receiving amounts, and without them the 'receives' badge cannot render. This is an expected data-availability failure, not a network error.","triggerScenarios":"Requesting /liberapay/receives/<entity> where the fetched profile JSON has no usable `receiving` object — receiving amounts are private or zero/hidden.","commonSituations":"User enabled receiving-amount privacy on Liberapay; account with no patrons so receiving stats are hidden; misspelled entity name resolving to a different profile without public receiving data.","solutions":["Disable the 'hide receiving amounts' privacy setting in the Liberapay profile (Privacy tab) if it is your account.","For other users' private profiles, switch to the goal badge or remove the receives badge.","Double-check the entity/username spelling in the badge URL."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const res = await fetch(`https://liberapay.com/${entity}/public.json`);\nconst data = await res.json();\nconst receivesPublicly = Boolean(data.receiving && data.receiving.amount != null);\nif (!receivesPublicly) console.warn(`${entity} does not publish receiving stats`);","typeGuard":"function hasPublicReceiving(data) {\n  return Boolean(data?.receiving && typeof data.receiving.amount === 'number' && typeof data.receiving.currency === 'string');\n}","tryCatchPattern":"try {\n  badge = await getLiberapayReceivesBadge(entity);\n} catch (e) {\n  if (e.name === 'InvalidResponse') {\n    badge = renderBadge('receives', 'hidden');\n  } else throw e;\n}","preventionTips":["Disable the receiving-amount privacy setting on the Liberapay account","Handle hidden profiles gracefully with an 'hidden' placeholder","Double-check the entity/username spelling before generating the badge"],"tags":["liberapay","privacy","invalid-response","empty-data"],"backgroundTag":"upstream-data-hidden-or-missing","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}