badges/shields · error · InvalidResponse

no result

Error message

no result

What it means

This InvalidResponse is thrown after the RE2 pattern compiled successfully but re2.exec(buffer) returns null, meaning the downloaded document (buffer) contains no substring matching the search regex. The service treats a non-match as an invalid/empty upstream response, yielding a 'no result' badge.

Source

Thrown at services/dynamic/dynamic-regex.service.js:96

  static transform(buffer, search, replace, flags) {
    // build re2 regex
    let re2
    try {
      re2 = new RE2(search, flags)
    } catch (error) {
      if (error instanceof SyntaxError) {
        throw new InvalidParameter({
          prettyMessage: `Invalid re2 regex: ${error.message}`,
        })
      }
      throw error
    }

    // extract value
    const found = re2.exec(buffer)
    if (found == null) {
      throw new InvalidResponse({
        prettyMessage: 'no result',
      })
    }

    // replace if needed
    return replace !== undefined ? found[0].replace(re2, replace) : found[0]
  }

  async handle(namedParams, { url, search, replace, flags }) {
    this.constructor.validate(flags)
    const { buffer } = await this._request({
      url,
      httpErrors,
      logErrors: [],
      options: { timeout: { request: 3500 } },
    })
    const value = this.constructor.transform(buffer, search, replace, flags)
    return renderDynamicBadge({ value })

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Fetch the url manually and verify the search pattern actually matches its current content.
  2. Loosen the regex (add the i flag, broaden whitespace/optional segments).
  3. Confirm the url returns the expected document (check for auth/error pages).
  4. Test the regex locally with an RE2 engine, then update the badge URL.

Example fix

// before
search="downloads":(\d+)   // live JSON now: "total_downloads": 123
// after
search="total_downloads":\s*(\d+)
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight: ensure the pattern matches the live document
const RE2 = require('re2');
const body = await fetch(url).then(r => r.text());
if (!new RE2(search, flags ?? '').test(body)) throw new Error('pattern does not match live document');

Try / catch

try {
  const value = await dynamicRegex({ url, search });
} catch (err) {
  if (err.message === 'no result') {
    // fall back to a default value or re-check the upstream page format
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: The target document at the url does not contain text matching the search pattern: pattern too strict, target page changed its format, or the response is an error page (login page, 404 HTML) rather than the expected payload.

Common situations: Upstream site redesigns its JSON/HTML so the key no longer appears; pattern written against an example document rather than the live one; response is compressed/HTML error page; case sensitivity (missing 'i' flag).

Related errors


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