Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit168e8b5

Browse files
committed
refactor: use es6 class syntax for CommandError
This is supposed to be a NOOP, although for some reason this makes adifference in the ava@6 test framework. This should not have auser-visible effect because CommandError is an implementation detail ofthis library (it's only thrown if `options.fatal` is off, and it'salways caught inside of common.js).
1 parent697bcf6 commit168e8b5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎src/common.js‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ exports.convertErrorOutput = convertErrorOutput;
8383

8484
// An exception class to help propagate command errors (e.g., non-zero exit
8585
// status) up to the top-level. {@param value} should be a ShellString.
86-
functionCommandError(value){
87-
this.returnValue=value;
86+
classCommandErrorextendsError{
87+
constructor(value){
88+
super(value.toString());
89+
this.returnValue=value;
90+
}
8891
}
89-
CommandError.prototype=Object.create(Error.prototype);
90-
CommandError.prototype.constructor=CommandError;
9192
exports.CommandError=CommandError;// visible for testing
9293

9394
// Shows error message. Throws if fatal is true (defaults to config.fatal, overridable with options.fatal)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp