Socket
Socket
Sign inDemoInstall

makeerror

Package Overview
Dependencies
1
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

makeerror

A library to make errors.


Version published
Maintainers
1
Weekly downloads
16,282,118
decreased by-25.82%

Weekly downloads

Readme

Source

makeerror

A library to make errors. Makes an Error constructor function with the signature:

function(message, data)

You'll typically do something like:

var makeError = require('makeerror')
var UnknownFileTypeError = makeError(
  'UnknownFileTypeError',
  'The specified type is not known.'
)
var er = UnknownFileTypeError()

er will have a prototype chain that ensures:

er instanceof Error
er instanceof UnknownFileTypeError

You can also do var er = new UnknownFileTypeError() if you really like the new keyword.

FAQs

Last updated on 17 Aug 2011

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc