{"record":{"id":"6775c36b5cbc2668","repo":"jackwener/OpenCLI","slug":"no-upwork-jobs-matched-query-location-in","errorCode":null,"errorMessage":"No Upwork jobs matched \"${query}\"${location ? ` in ${location}` : ''}","messagePattern":"No Upwork jobs matched \"(.+?)\"(.+?)` : ''\\}","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/upwork/search.js","lineNumber":105,"sourceCode":"        if (payload?.onLogin) {\n            throw new AuthRequiredError('upwork.com', 'Upwork redirected to login. Open https://www.upwork.com in the connected browser and sign in, then retry.');\n        }\n        if (payload?.challenge) {\n            throw new CommandExecutionError('Upwork served a Cloudflare challenge page', 'Open https://www.upwork.com in the connected browser and clear the challenge, then retry.');\n        }\n        if (!payload?.ready) {\n            throw new CommandExecutionError('Upwork search state (window.__NUXT__.state.jobsSearch) was not present within 15s', 'The page may not have finished hydrating, or the SSR state shape may have changed.');\n        }\n        if (!isPlainObject(payload)) {\n            throw new CommandExecutionError('Upwork search returned an unexpected Browser Bridge payload shape');\n        }\n        if (!payload.jobsPresent || !Array.isArray(payload.jobs)) {\n            throw new CommandExecutionError('Upwork search state had an unexpected jobs shape; expected window.__NUXT__.state.jobsSearch.jobs to be an array.');\n        }\n\n        const jobs = payload.jobs;\n        if (jobs.length === 0) {\n            throw new EmptyResultError('upwork search', `No Upwork jobs matched \"${query}\"${location ? ` in ${location}` : ''}`);\n        }\n\n        const offset = (pageNum - 1) * perPage;\n        const rows = jobsToListRows(jobs, { offset, limit: perPage });\n        if (rows.length === 0) {\n            throw new CommandExecutionError('Upwork search results did not include any job with a valid ciphertext id; cannot produce round-trippable detail rows.');\n        }\n        return rows;\n    },\n});\n","sourceCodeStart":87,"sourceCodeEnd":116,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/upwork/search.js#L87-L116","documentation":"An EmptyResultError raised when the search completed successfully but zero jobs matched the query (and optional location filter). This is the library's normal signal for a valid search with no hits, not a malfunction. The query text and location are interpolated into the message.","triggerScenarios":"Calling upwork search with a query string (or query+location combination) that returns an empty jobs array in window.__NUXT__.state.jobsSearch.jobs.","commonSituations":"Overly specific queries or exotic skill keywords; a location filter with no matching openings; typos in the query; searching a niche category at an off time; region-restricted results where the query has no local listings.","solutions":["Retry with broader or fewer search terms.","Drop or generalize the location filter.","Check the query for typos and use terms that appear in real Upwork job titles.","Browse upwork.com manually with the same query to confirm there really are no matches before treating it as a CLI bug."],"exampleFix":"// before\nawait cli.search('cobol blockchain quantum widget') // EmptyResultError\n// after\nawait cli.search('blockchain developer') // broader query\n// or catch and fall back:\ntry { await cli.search(query) } catch (e) { if (e instanceof EmptyResultError) return []; throw e; }","handlingStrategy":"try-catch","validationCode":"// sanity-check the query before searching\nconst q = query.trim();\nif (!q) throw new Error('Query required');\nif (q.split(/\\s+/).length > 8) console.warn('Very specific query may return zero results');","typeGuard":"function isEmptySearch(jobs) {\n  return Array.isArray(jobs) && jobs.length === 0;\n}","tryCatchPattern":"try {\n  rows = await cli.search(query);\n} catch (e) {\n  if (e.name === 'EmptyResultError' || String(e.message).startsWith('No Upwork jobs matched')) {\n    return []; // legitimately no matches - handle as empty, not failure\n  } else throw e;\n}","preventionTips":["Treat EmptyResultError as an expected outcome and catch it separately from real failures.","Start with broad queries and narrow iteratively.","Test unusual queries on upwork.com manually to confirm they can ever match.","Generalize or drop location filters when combining them with niche queries."],"tags":["empty-results","search","upwork","query"],"backgroundTag":"empty-search-results","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}