Installing dependencies.
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
# @semantic-release/error
|
||||
|
||||
Error type used by all [semantic-release](https://github.com/semantic-release/semantic-release) packages.
|
||||
|
||||
[](https://github.com/semantic-release/error/actions?query=workflow%3ATest+branch%3Amaster)
|
||||
|
||||
Errors of type `SemanticReleaseError` or an inherited type will be considered by [semantic-release](https://github.com/semantic-release/semantic-release) 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](https://github.com/semantic-release/semantic-release) 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
|
||||
|
||||
```js
|
||||
const SemanticReleaseError = require("@semantic-release/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.");
|
||||
```
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
module.exports = class SemanticReleaseError extends Error {
|
||||
constructor(message, code, details) {
|
||||
super(message);
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
this.name = 'SemanticReleaseError';
|
||||
this.code = code;
|
||||
this.details = details;
|
||||
this.semanticRelease = true;
|
||||
}
|
||||
};
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"name": "@semantic-release/error",
|
||||
"description": "errors with more than just a message",
|
||||
"version": "3.0.0",
|
||||
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
|
||||
"ava": {
|
||||
"files": [
|
||||
"test/**/*.test.js"
|
||||
]
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/semantic-release/error/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "3.15.0",
|
||||
"codecov": "3.8.3",
|
||||
"nyc": "15.1.0",
|
||||
"xo": "0.38.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/semantic-release/error#readme",
|
||||
"keywords": [
|
||||
"error",
|
||||
"semantic-release"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"nyc": {
|
||||
"include": [
|
||||
"index.js"
|
||||
],
|
||||
"reporter": [
|
||||
"json",
|
||||
"text",
|
||||
"html"
|
||||
],
|
||||
"all": true
|
||||
},
|
||||
"prettier": {
|
||||
"printWidth": 120,
|
||||
"trailingComma": "es5"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/semantic-release/error.git"
|
||||
},
|
||||
"scripts": {
|
||||
"codecov": "codecov -f coverage/coverage-final.json",
|
||||
"lint": "xo",
|
||||
"pretest": "npm run lint",
|
||||
"semantic-release": "semantic-release",
|
||||
"test": "nyc ava -v",
|
||||
"test:ci": "nyc ava -v"
|
||||
},
|
||||
"xo": {
|
||||
"prettier": true,
|
||||
"space": true,
|
||||
"rules": {
|
||||
"unicorn/string-content": "off"
|
||||
}
|
||||
},
|
||||
"renovate": {
|
||||
"extends": [
|
||||
"github>semantic-release/.github"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user