badges/shields · warning · InvalidResponse

Unknown status received

Error message

Unknown status received

What it means

This InvalidResponse error is thrown by the PingPong status service's render method when the API returns a status string that is not one of the recognized cases (e.g. 'Operational', 'Degraded state', 'Issues state', 'Critical state', 'Maintenance mode'). It indicates the upstream PingPong API introduced a new/changed status label the badge does not understand.

Source

Thrown at services/pingpong/pingpong-status.service.js:38

        }),
      },
    },
  }

  static defaultBadgeData = { label: 'status' }

  static render({ status }) {
    switch (status) {
      case 'Operational':
        return { message: 'up', color: 'brightgreen' }
      case 'Major issues':
        return { message: 'issues', color: 'orange' }
      case 'Critical state':
        return { message: 'down', color: 'red' }
      case 'Maintenance mode':
        return { message: 'maintenance', color: 'lightgrey' }
      default:
        throw new InvalidResponse({
          prettyMessage: 'Unknown status received',
        })
    }
  }

  async fetch({ apiKey }) {
    return this._requestJson({
      schema,
      url: `${baseUrl}/status/${apiKey}`,
    })
  }

  async handle({ apiKey }) {
    this.constructor.validateApiKey({ apiKey })
    const { status } = await this.fetch({ apiKey, schema })
    return this.constructor.render({ status })
  }
}

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Update/shields-io to a version whose PingPong service handles the new status string
  2. File an issue upstream with the exact status text received so a case can be added
  3. Temporarily use a different badge for that component
  4. Check the PingPong API docs/changelog for renamed status labels

Example fix

// before
switch (status) { case 'Operational': ... }
// after
switch (status) {
  case 'Partially degraded service': return { message: 'degraded', color: 'yellow' }
  case 'Operational': ...
}
Defensive patterns

Strategy: fallback

Type guard

function isKnownStatus(status) {
  return ['Operational', 'Partially degraded service', 'Issues state', 'Critical state', 'Maintenance mode'].includes(status)
}

Try / catch

try {
  const badge = await pingpongStatus(apiKey)
} catch (e) {
  if (e instanceof InvalidResponse && e.message === 'Unknown status received') return { message: 'unknown status', color: 'lightgrey' }
  throw e
}

Prevention

When it happens

Trigger: The PingPong status endpoint responds with a status text outside the switch statement's cases — typically a newly added status level or a localized/renamed status string.

Common situations: PingPong platform updating its status vocabulary; an account with an incident state not covered by the badge logic; API version drift.

Related errors


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