badges/shields · error · NotFound

resource not found

Error message

resource not found

What it means

The voxelshop rating service throws NotFound when the upstream VoxelShop API responds but contains no 'resource' object for the given resourceId. This means VoxelShop has no product/resource matching the requested id, so no review count or average rating can be rendered.

Source

Thrown at services/voxelshop/voxelshop-rating.service.js:53

  static defaultBadgeData = {
    label: 'rating',
  }

  static render({ format, total, average }) {
    const message =
      format === 'stars'
        ? starRating(average)
        : `${average}/5 (${metric(total)})`
    return {
      message,
      color: floorCount(average, 2, 3, 4),
    }
  }

  async handle({ format, resourceId }) {
    const { response } = await this.fetch({ resourceId })
    if (!response.resource) {
      throw new NotFound()
    }
    return this.constructor.render({
      format,
      total: response.resource.reviews.count,
      average: response.resource.reviews.stars.toFixed(2),
    })
  }
}

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Verify the resourceId by opening the product page on voxelshop.com and confirming the id in its URL
  2. Re-check spelling and casing of the resourceId parameter
  3. If the product was removed, remove or update the badge
  4. Confirm the VoxelShop API is reachable and still serving that resource

Example fix

// before
handle({ resourceId: 'voxel-atlas-2' })
// after
handle({ resourceId: 'voxel-atlas' }) // corrected id verified on the product page
Defensive patterns

Strategy: try-catch

Validate before calling

// verify the resource exists before rendering
const res = await fetch(`https://voxelshop.com/api/resource/${resourceId}`).then(r => r.json())
if (!res?.resource) throw new Error(`Unknown VoxelShop resourceId: ${resourceId}`)

Type guard

function hasResource(r) { return r != null && typeof r === 'object' && r.resource != null && r.resource.reviews != null }

Try / catch

try {
  const badge = await voxelshopRating.handle({ format, resourceId })
} catch (e) {
  if (e instanceof NotFound) {
    // render a fallback badge, e.g. 'voxelshop | not found'
  } else throw e
}

Prevention

When it happens

Trigger: Calling the badge with a resourceId that does not exist in VoxelShop's catalog, or a resourceId that has been deleted/renamed, causing response.resource to be undefined.

Common situations: Typo in the product id, product removed from the shop, using an internal id instead of the shop-facing resource id, or the shop itself being offline/decommissioned.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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