Skip to content

Commit ee4e856

Browse files
AiosaKrinkle
andauthored
Avoid unsupported util.isError function removed in Node.js 24
Fixes #46. Co-authored-by: Timo Tijhof <krinkle@fastmail.com>
1 parent d33b40a commit ee4e856

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
// Nodejs libs.
1313
var spawn = require('child_process').spawn;
14-
var nodeUtil = require('util');
1514
var path = require('path');
1615

1716
// The module to be exported.
@@ -52,7 +51,7 @@ util.callbackify = function(fn) {
5251
// Create a new Error object, with an origError property that will be dumped
5352
// if grunt was run with the --debug=9 option.
5453
util.error = function(err, origError) {
55-
if (!nodeUtil.isError(err)) { err = new Error(err); }
54+
if (!(err instanceof Error)) { err = new Error(err); }
5655
if (origError) { err.origError = origError; }
5756
return err;
5857
};

0 commit comments

Comments
 (0)