qeeqbox/social-analyzer · info
info.original + ' [Error]<br>Try this: ' + info.corrected
Error message
info.original + ' [Error]<br>Try this: ' + info.corrected
What it means
In check_engines (modules/external-apis.js:91) info.checking is assigned a message string, not an Error thrown by the library. The message `info.original + ' [Error]<br>Try this: ' + info.corrected` is built when the Google Custom Search JSON API returns zero total results but includes a spelling correction (spelling.correctedQuery). It signals the searched term yielded no hits and Google suggests an alternative spelling.
Source
Thrown at modules/external-apis.js:91
info.original = response.data.queries.request[0].searchTerms
} catch (e) {}
try {
info.corrected = response.data.spelling.correctedQuery
} catch (e) {}
try {
info.total = response.data.searchInformation.totalResults
} catch (e) {}
try {
response.data.items.forEach(function (item) {
info.items.push({
title: item.title,
snippet: item.snippet
})
})
} catch (e) {}
try {
if (info.total === 0 && info.corrected !== '') {
info.checking = info.original + ' [Error]<br>Try this: ' + info.corrected
} else if (info.total > 0 && info.corrected !== '') {
info.checking = info.original + ' [Good]<br>Suggested word: ' + info.corrected + '<br>Total lookups: ' + info.total
} else if (info.total > 0 && info.corrected === '') {
info.checking = info.original + ' [Good]<br>Total lookups: ' + info.total
} else {
info.checking = 'Using ' + info.original + ' with no lookups'
}
} catch (e) {}
}
} catch (error) {
helper.verbose && console.log(error)
}
}
async function custom_search_ouputs (req) {
const possible_parameters = ['user', 'profile', 'account']
const time = new Date()
const functions = []View on GitHub (pinned to 1ba0905e00)
Solutions
- Check info.checking for the '[Error]' marker and retry with the suggested word parsed after 'Try this: ',' or use info.corrected directly as the corrected query
- Validate that Google API key and CX are valid and the CSE is configured to search the whole web, so totalResults is meaningful
- Treat totalResults as a string/number defensively (it is a string in the API; '0' vs 0 comparisons can misbranch)
- If lookups always show 0, verify quota (100 free queries/day) and that responses are not empty due to get_url_wrapper_json failures
Example fix
// before
console.log(info.checking) // 'johnn [Error]<br>Try this: johnny'
// after
if (info.checking && info.checking.includes('[Error]')) {
const suggestion = info.corrected
// re-run the search with `suggestion` instead of info.original
} Defensive patterns
Strategy: try-catch
Validate before calling
if (helper.google_api_key === '' || helper.google_api_cs === '') {
// skip engine check entirely, as check_engines itself does
}
if (!info || typeof info !== 'object') throw new TypeError('info object required') Type guard
function hasNoResultsWithSuggestion(info) {
return info && Number(info.total) === 0 && typeof info.corrected === 'string' && info.corrected !== ''
} Try / catch
try {
await check_engines(req, info)
if (typeof info.checking === 'string' && info.checking.includes('[Error]')) {
// no results: retry with info.corrected as the query
}
} catch (e) {
// API/transport failure: degrade gracefully, keep info.checking undefined
} Prevention
- Validate info fields (total, corrected, original) are set before reading info.checking
- Coerce searchInformation.totalResults with Number() — the API returns it as a string
- Check Google API quota and key/CX validity so results are not silently empty
- Guard for missing response.data.queries/spelling paths before dereferencing
When it happens
Trigger: Calling check_engines (via custom_search flows) where helper.get_url_wrapper_json against googleapis.com/customsearch/v1 succeeds but the response has searchInformation.totalResults === 0 and a non-empty spelling.correctedQuery — i.e. a misspelled or no-result query when google_api_key and google_api_cs are configured.
Common situations: Developers searching username strings with special characters that Google treats as misspellings; quota-exhausted or malformed API responses parsing to empty fields so info.total stays 0/undefined; wrong CX (custom search engine id) scoped to no sites, returning 0 results with odd suggestions.
AI-assisted analysis of qeeqbox/social-analyzer@1ba0905e00 (2026-08-31).
Data as JSON: /api/errors/bcdf53d530db73d1.
Report an issue: GitHub.