Json.stringify Missing Properties
I'm writing a custom console.error function so that every time an error occurs I receive an e-mail. To send the error in e-mail body I use JSON.stringify(). The problem is that it
Solution 1:
Edit : See this.
Since your Error object is inside another object, you might have to use 2 stringify calls :
JSON.stringify({
0: ...,
1: JSON.stringify({errorObject, ["message", "arguments", "type", "name"]}),
});
Or something like that.
If I'm getting this correctly, the informations you are lacking are in the Error object. My guess would be that JSON.stringify calls .toString() for each object inside it. Though, for an Error object, maybe the toString() function doesn't return ALL the informations you want, versus what you see in the console.
Maybe you'll have to call the Error object's .description() function yourself.
Post a Comment for "Json.stringify Missing Properties"