badges/shields · error · InvalidResponse

${message}

Error message

${message}

What it means

This InvalidResponse error is raised by the POEditor badge render method when the POEditor API responds with a non-200 code; the API's own error message becomes the badge message. This surfaces upstream API failures (auth problems, invalid project id, rate limits) directly on the badge.

Source

Thrown at services/poeditor/poeditor.service.js:70

        description,
        parameters: [
          pathParam({ name: 'projectId', example: '323337' }),
          pathParam({ name: 'languageCode', example: 'fr' }),
          queryParam({
            name: 'token',
            example: 'abc123def456',
            description:
              'A read-only token from your POEditor account from [My Account > API Access](https://poeditor.com/account/api)',
            required: true,
          }),
        ],
      },
    },
  }

  static render({ code, message, language }) {
    if (code !== 200) {
      throw new InvalidResponse({ prettyMessage: message })
    }

    if (language === undefined) {
      throw new InvalidResponse({ prettyMessage: 'Language not in project' })
    }

    return {
      label: language.name,
      message: `${language.percentage.toFixed(0)}%`,
      color: coveragePercentage(language.percentage),
    }
  }

  async fetch({ projectId, token }) {
    return this._requestJson({
      schema,
      url: 'https://api.poeditor.com/v2/languages/list',
      options: {

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Check the exact error message shown and fix the corresponding input (token, project id, or language code)
  2. Verify the POEditor API token in your config is valid and active at poeditor.com
  3. Confirm the project id and language code exist in your POEditor account
  4. Retry later if POEditor itself is having an outage

Example fix

// before
apiToken: ''  (POEditor returns 405 'Invalid API key')
// after
apiToken: 'your-valid-poeditor-token'
Defensive patterns

Strategy: try-catch

Validate before calling

if (!apiToken) throw new Error('POEditor API token is required')
if (!Number.isInteger(projectId) || projectId <= 0) throw new Error('Valid POEditor project id required')

Type guard

function isPoeditorSuccess(res) {
  return typeof res === 'object' && res !== null && res.response?.code === 200 && typeof res.response?.message === 'string'
}

Try / catch

try {
  const badge = await poeditorCoverage(params)
} catch (e) {
  if (e instanceof InvalidResponse) console.warn(`POEditor API error: ${e.message} — check token, project id, and language`)
  else throw e
}

Prevention

When it happens

Trigger: Calling a POEditor badge with an invalid or missing API token, a wrong project id, a language not in the project, or while POEditor is returning any error code (e.g. 403 'Invalid API token', 404 'Project not found').

Common situations: Expired or revoked POEditor API tokens; wrong project id in the badge URL; requesting a language code the project does not define; POEditor API quota exhaustion.

Related errors


AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30). Data as JSON: /api/errors/78f164b6df1d5dc6. Report an issue: GitHub.