File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -257,17 +257,19 @@ router.get(
257
257
if ( process . env . NODE_ENV === 'development' ) {
258
258
console . error ( 'Error calling getSearchResults()' , error )
259
259
} else {
260
- await Promise . all (
261
- FailBot . report ( error , {
262
- url : req . url ,
263
- indexName,
264
- query,
265
- page,
266
- size,
267
- debug,
268
- sort,
269
- } )
270
- )
260
+ const reports = FailBot . report ( error , {
261
+ url : req . url ,
262
+ indexName,
263
+ query,
264
+ page,
265
+ size,
266
+ debug,
267
+ sort,
268
+ } )
269
+ // It might be `undefined` if no backends are configured which
270
+ // is likely when using production NODE_ENV on your laptop
271
+ // where you might not have a HATSTACK_URL configured.
272
+ if ( reports ) await Promise . all ( reports )
271
273
}
272
274
res . status ( 500 ) . send ( error . message )
273
275
}
You can’t perform that action at this time.
0 commit comments