You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
431 B
JavaScript

"use strict";
const util = require("util");
module.exports = function assertErrorType(error) {
if (!(error instanceof Error)) {
let stack = (new Error).stack
.split("\n")
.filter((line, n) => (n > 0 || !line.startsWith("Error")))
.join("\n");
console.warn(`Converted Node stream produced an error value that isn't an Error instance: ${util.inspect(error)}`);
console.warn(`Stack:`);
console.warn(stack);
}
};