3.0.1 • Published 1 year ago
@semantic-release-plus/error v3.0.1
@semantic-release-plus/error
Error type used by all "@semantic-release-plus packages.
Errors of type SemanticReleaseError
or an inherited type will be considered by "@semantic-release-plus as an expected exception case (no release to be done, running on a PR etc..). That indicate to the semantic-release
process to stop and exit with the 0
success code.
Any other type of error will be considered by "@semantic-release-plus as an unexpected error (i/o issue, code problem etc...). That indicate to the semantic-release
process to stop, log the error and exit with the 1
failure code.
Usage
const SemanticReleaseError = require('@semantic-release-plus/error');
// Default
throw new SemanticReleaseError();
// With error message
throw new SemanticReleaseError('An error happened');
// With error message and error code
throw new SemanticReleaseError('An error happened', 'ECODE');
// With error message, error code and details
throw new SemanticReleaseError(
'An error happened',
'ECODE',
'Here is some suggestions to solve this error.'
);
// With inheritance
class InheritedError extends SemanticReleaseError {
constructor(message, code, newProperty, details) {
super(message);
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.code = code;
this.details = details;
this.newProperty = 'newProperty';
}
}
throw new InheritedError(
'An error happened',
'ECODE',
'Here is some suggestions to solve this error.'
);
4.0.0-alpha.3
1 year ago
3.0.1
2 years ago
4.0.0-alpha.1
3 years ago
4.0.0-alpha.2
3 years ago
3.0.0-alpha.1
4 years ago
3.0.0-beta.1
4 years ago
3.0.0-beta.2
4 years ago
3.0.0
4 years ago
2.3.0-beta.1
4 years ago
2.3.0-alpha.4
4 years ago
2.3.0-alpha.3
4 years ago
2.3.0-alpha.2
4 years ago
2.3.0-alpha.1
4 years ago