Reputation: 55
I get the following error "ReferenceError: printStackTrace is not defined", when I tried to use StackTrace in my angular aplication.
Upvotes: 3
Views: 2186
Reputation: 44349
stacktrace.js changed the API for v1.0.
You'll want to use
var callback = function(frames) { console.log(frames); };
var errback = function(err) { console.log(err.message); };
StackTrace.get().then(callback).catch(errback);
as suggested by the docs.
If all you want to do is parse an Error
you can just use error-stack-parser
Please refer to the v0.x -> v1.x migration guide if you were using the old version.
By the way, if you need to use version 0.x you can find it in the stable branch on GitHub
Upvotes: 4