@semantic-release/error
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -7,3 +7,4 @@ module.exports = class SemanticReleaseError extends Error { | ||
this.code = code; | ||
this.semanticRelease = true; | ||
} | ||
}; |
@@ -1,1 +0,1 @@ | ||
{"name":"@semantic-release/error","description":"errors with more than just a message","version":"2.0.1","author":"Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)","bugs":{"url":"https://github.com/semantic-release/error/issues"},"config":{"commitizen":{"path":"cz-conventional-changelog"}},"devDependencies":{"ava":"^0.23.0","codecov":"^3.0.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.7.0","eslint-config-prettier":"^2.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-import":"^2.7.0","eslint-plugin-node":"^5.1.1","eslint-plugin-prettier":"^2.2.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","nyc":"^11.2.1","prettier":"^1.7.0","rimraf":"^2.6.2","semantic-release":"^8.0.0"},"eslintConfig":{"extends":["standard","prettier"],"plugins":["prettier"],"rules":{"prettier/prettier":2}},"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,"singleQuote":true,"bracketSpacing":false,"trailingComma":"es5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"https://github.com/semantic-release/error.git"},"scripts":{"clean":"rimraf coverage && rimraf .nyc_output","cm":"git-cz","codecov":"codecov -f coverage/coverage-final.json","lint":"eslint .","pretest":"npm run clean && npm run lint","semantic-release":"semantic-release pre && npm publish && semantic-release post","test":"nyc ava -v"}} | ||
{"name":"@semantic-release/error","description":"errors with more than just a message","version":"2.1.0","author":"Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)","bugs":{"url":"https://github.com/semantic-release/error/issues"},"config":{"commitizen":{"path":"cz-conventional-changelog"}},"devDependencies":{"ava":"^0.23.0","codecov":"^3.0.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.7.0","eslint-config-prettier":"^2.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-import":"^2.7.0","eslint-plugin-node":"^5.1.1","eslint-plugin-prettier":"^2.2.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","nyc":"^11.2.1","prettier":"^1.7.0","rimraf":"^2.6.2","semantic-release":"^8.0.0"},"eslintConfig":{"extends":["standard","prettier"],"plugins":["prettier"],"rules":{"prettier/prettier":2}},"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,"singleQuote":true,"bracketSpacing":false,"trailingComma":"es5"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"https://github.com/semantic-release/error.git"},"scripts":{"clean":"rimraf coverage && rimraf .nyc_output","cm":"git-cz","codecov":"codecov -f coverage/coverage-final.json","lint":"eslint .","pretest":"npm run clean && npm run lint","semantic-release":"semantic-release pre && npm publish && semantic-release post","test":"nyc ava -v"}} |
@@ -5,2 +5,6 @@ # @semantic-release/error | ||
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. | ||
[![npm](https://img.shields.io/npm/v/@semantic-release/error.svg)](https://www.npmjs.com/package/@semantic-release/error) | ||
@@ -29,2 +33,15 @@ [![Greenkeeper badge](https://badges.greenkeeper.io/semantic-release/error.svg)](https://greenkeeper.io/) | ||
throw new SemanticReleaseError('An error happened', 'ECODE'); | ||
// With inheritance | ||
class InheritedError extends SemanticReleaseError { | ||
constructor(message, code, newProperty) { | ||
super(message); | ||
Error.captureStackTrace(this, this.constructor); | ||
this.name = this.constructor.name; | ||
this.code = code; | ||
this.newProperty = 'newProperty'; | ||
} | ||
} | ||
throw new InheritedError('An error happened', 'ECODE'); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
5366
9
46
1