Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working with chrome? Cannot parse given Error object #198

Open
embryologist opened this issue Sep 3, 2017 · 10 comments
Open

not working with chrome? Cannot parse given Error object #198

embryologist opened this issue Sep 3, 2017 · 10 comments

Comments

@embryologist
Copy link

  window.onerror = function (msg, file, line, col, error) {
        StackTrace.fromError(error, line).then(callback).catch(errback);
    }
        var errback = function (err) {
            console.log(err.message);
    };
    var callback = function (stackframes) {
        var stringifiedStack = stackframes.map(function (sf) {
            return sf.toString();
        }).join('\n');
    };

Cannot parse given Error object
adding,

  window.onerror = function (msg, file, line, col, error) {
        StackTrace.fromError(error, line).then(callback).catch(errback);
    }
        var errback = function (err) {
            console.log(new Error("from onerror").stack);
    };
    var callback = function (stackframes) {
        var stringifiedStack = stackframes.map(function (sf) {
            return sf.toString();
        }).join('\n');
    };

Error: from onerror at errback (PatientRegistration:1590) at anonymous

@embryologist
Copy link
Author

@eriwen, is this a new issue, I m using cdn lib

@rgfactory
Copy link

This error occurs if you throw a string. You have to do new Error("your string").

@ubershmekel
Copy link

@rgfactory an error may be in a 3rd party library, or a programmer made a mistake. A library designed to handle errors shouldn't break in the face of a common error.

@1-0-1
Copy link

1-0-1 commented Nov 15, 2017

Just started using this and I'm getting this error, too. I am getting it when passing back a Response from http in Angular 4.

@embryologist
Copy link
Author

I am closing this. the dev totally ignored it. I moved to angular and this project does not stop throwing weird errors left and right.

@capaj
Copy link

capaj commented May 8, 2019

@embryologist how does closing the issue help?

@ubershmekel
Copy link

@embryologist - I will open a separate issue if you keep this closed. Please re-open.

@niftylettuce
Copy link
Contributor

Re-opened. We will resolve this.

@mmarekbb
Copy link

Has there been any progress on this issue? We now started getting it as well. This ticket has been open for almost 5 years.

@zlawson-ut
Copy link

zlawson-ut commented May 7, 2022

This error was being thrown for me due to passing a String or Response to StackTrace.fromError. It'd be good from developer experience perspective if StackTrace handled things like this or raised a helpful error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

8 participants