endangeredmassa / format-error Goto Github PK
View Code? Open in Web Editor NEWformat errors for display
License: MIT License
format errors for display
License: MIT License
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)
...
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.