Socket
Socket
Sign inDemoInstall

standard-error

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

1.1.0

Diff

Changelog

Source

1.1.0 (Jun 15, 2014)

  • Allows overwriting the stack property if given in the object:

    new StandardError({stack: stackOverflow})
    
  • Fixes stack's first line when name given in the object:

    new StandardError({name: "UnknownError"})
    
  • Allows overriding name explicitly through the subclass's prototype.
    Previously StandardError got the name only from the constructor function's name property or from the passed-in object.

    function ChildError(msg, props) { StandardError.apply(this, arguments) }
    
    ChildError.prototype = Object.create(StandardError.prototype, {
      constructor: {value: ChildError, configurable: true, writeable: true}
    })
    
    ChildError.prototype.name = "FallacyError"
    
  • Sets StandardError.prototype.name explicitly for cases where the code is minified.
    If you don't minify your code (like when using it on the server side) you don't need to set name explicitly on your subclasses and can depend on StandardError.js finding it out from the constructor function.

  • Uses Error.captureStackTrace only if available, so it'll work in non-V8 JavaScript engines.

moll
published 1.0.0 •

Changelog

Source

1.0.0 (May 1, 2014)

  • First standard release.
    There are now 15 competing standards!
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