Skip to content

Commit f1b79f7

Browse files
committed
get rid of utils. prefix from createExpressError
1 parent 477abfa commit f1b79f7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

controllers/search.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ const searchFuzzily = async function (req, res, next) {
455455
res.json(results)
456456
} catch (error) {
457457
console.error(error)
458-
next(utils.createExpressError(error))
458+
next(createExpressError(error))
459459
}
460460
}
461461

@@ -525,7 +525,7 @@ const searchWildly = async function (req, res, next) {
525525
message: "You did not provide text to search for in the search request.",
526526
status: 400
527527
}
528-
next(utils.createExpressError(err))
528+
next(createExpressError(err))
529529
return
530530
}
531531
// Require wildcards in the search text
@@ -534,7 +534,7 @@ const searchWildly = async function (req, res, next) {
534534
message: "Wildcards must be used in wildcard search. Use '*' to match any characters or '?' to match a single character.",
535535
status: 400
536536
}
537-
next(utils.createExpressError(err))
537+
next(createExpressError(err))
538538
return
539539
}
540540
const limit = parseInt(req.query.limit ?? 100)
@@ -552,7 +552,7 @@ const searchWildly = async function (req, res, next) {
552552
res.json(results)
553553
} catch (error) {
554554
console.error(error)
555-
next(utils.createExpressError(error))
555+
next(createExpressError(error))
556556
}
557557
}
558558

@@ -629,7 +629,7 @@ const searchAlikes = async function (req, res, next) {
629629
message: "You must provide a JSON document in the request body to find similar documents.",
630630
status: 400
631631
}
632-
next(utils.createExpressError(err))
632+
next(createExpressError(err))
633633
return
634634
}
635635
const limit = parseInt(req.query.limit ?? 100)
@@ -686,7 +686,7 @@ const searchAlikes = async function (req, res, next) {
686686
res.json(results)
687687
} catch (error) {
688688
console.error(error)
689-
next(utils.createExpressError(error))
689+
next(createExpressError(error))
690690
}
691691
}
692692

0 commit comments

Comments
 (0)