Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@semantic-release/error

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@semantic-release/error

errors with more than just a message

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.3M
decreased by-30.4%
Maintainers
4
Weekly downloads
 
Created
Source

@semantic-release/error

Error type used by all semantic-release packages.

Errors of type SemanticReleaseError or an inherited type will be considered by 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 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 Greenkeeper badge license styled with prettier semantic-release Commitizen friendly

Travis Codecov

Usage

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 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');

Keywords

FAQs

Package last updated on 29 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc