MCPcopy Index your code
hub / github.com/github/docs / handleGetSearchResultsError

Function handleGetSearchResultsError

middleware/api/search.js:302–313  ·  view source on GitHub ↗
(req, res, error, options)

Source from the content-addressed store, hash-verified

300// which is slightly different depending on the "sub-version" (e.g. /legacy)
301// This function is a single place to take care of all of these error handlings
302async function handleGetSearchResultsError(req, res, error, options) {
303 if (process.env.NODE_ENV === 'development') {
304 console.error(`Error calling getSearchResults(${options})`, error)
305 } else {
306 const reports = FailBot.report(error, Object.assign({ url: req.url }, options))
307 // It might be `undefined` if no backends are configured which
308 // is likely when using production NODE_ENV on your laptop
309 // where you might not have a HATSTACK_URL configured.
310 if (reports) await Promise.all(reports)
311 }
312 res.status(500).json({ error: error.message })
313}
314
315// Alias for the latest version
316router.get('/', (req, res) => {

Callers 1

search.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected