Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95277257
error.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Dec 14, 07:29
Size
1 KB
Mime Type
text/x-c++
Expires
Mon, Dec 16, 07:29 (2 d)
Engine
blob
Format
Raw Data
Handle
22917169
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
error.js
View Options
// @ts-check
/**
* CommanderError class
* @class
*/
class
CommanderError
extends
Error
{
/**
* Constructs the CommanderError class
* @param {number} exitCode suggested exit code which could be used with process.exit
* @param {string} code an id string representing the error
* @param {string} message human-readable description of the error
* @constructor
*/
constructor
(
exitCode
,
code
,
message
)
{
super
(
message
);
// properly capture stack trace in Node.js
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
this
.
name
=
this
.
constructor
.
name
;
this
.
code
=
code
;
this
.
exitCode
=
exitCode
;
this
.
nestedError
=
undefined
;
}
}
/**
* InvalidArgumentError class
* @class
*/
class
InvalidArgumentError
extends
CommanderError
{
/**
* Constructs the InvalidArgumentError class
* @param {string} [message] explanation of why argument is invalid
* @constructor
*/
constructor
(
message
)
{
super
(
1
,
'commander.invalidArgument'
,
message
);
// properly capture stack trace in Node.js
Error
.
captureStackTrace
(
this
,
this
.
constructor
);
this
.
name
=
this
.
constructor
.
name
;
}
}
exports
.
CommanderError
=
CommanderError
;
exports
.
InvalidArgumentError
=
InvalidArgumentError
;
Event Timeline
Log In to Comment