Git Product home page Git Product logo

format-error's People

Contributors

endangeredmassa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

dbushong

format-error's Issues

Barfs on circular structures

It would be nice if format-error could survive being handed potentially circular data structures.

TypeError: Converting circular structure to JSON
    at Object.stringify (native)
    at makeSimple (/.../node_modules/format-error/index.js:36:28)
    at format (/.../node_modules/format-error/index.js:39:21)
    ...

Extending Error class with ES6; looking up the prototype chain to find `stack` attribute?

I am fairly new to ES6 syntax and the specs. But I believe that you need to scan the prototype chain in order to get the property accessors since by the specs, stack and message are attached to their class prototype so the function getOwnPropertyDescriptors (here) will not have access to the prototype chain to access the base class Error@stack property. In other words, we have to assume the derived classes also have their own stack property descriptors if entire chain isn't scanned.

I was working on chaining causes with ES6 when I noticed this incompatibility. So, I have the script scanning the prototype chain. It is coupled with test case for here: https://github.com/bluejamesbond/TraceError.js/blob/master/tests/throw-test.js#L7 (the test case should identify 1 valid property namely: Error; the test will be updated soon to show that aspect)

Referencing mathew-kurian/TraceError.js#1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.