MCPcopy
hub / github.com/webpack/webpack-dev-server / errors

Function errors

client-src/index.js:551–585  ·  view source on GitHub ↗

* @param {Error[]} errors errors

(errors)

Source from the content-addressed store, hash-verified

549 * @param {Error[]} errors errors
550 */
551 errors(errors) {
552 log.error("Errors while compiling. Reload prevented.");
553
554 const printableErrors = errors.map((error) => {
555 const { header, body } = formatProblem("error", error);
556
557 return `${header}\n${stripAnsi(body)}`;
558 });
559
560 sendMessage("Errors", printableErrors);
561
562 for (let i = 0; i < printableErrors.length; i++) {
563 log.error(printableErrors[i]);
564 }
565
566 const overlayErrorsSettings =
567 typeof options.overlay === "boolean"
568 ? options.overlay
569 : options.overlay && options.overlay.errors;
570
571 if (overlayErrorsSettings) {
572 const errorsToDisplay =
573 typeof overlayErrorsSettings === "function"
574 ? errors.filter(overlayErrorsSettings)
575 : errors;
576
577 if (errorsToDisplay.length) {
578 overlay.send({
579 type: "BUILD_ERROR",
580 level: "error",
581 messages: errors,
582 });
583 }
584 }
585 },
586 /**
587 * @param {Error} error error
588 */

Callers

nothing calls this directly

Calls 3

formatProblemFunction · 0.90
stripAnsiFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…