Visitar URL original
not working with chrome? Cannot parse given Error object · Issue #198 · stacktracejs/stacktrace.js · GitHub
Skip to content

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

Description

@ConClavi
  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

Activity

  1. ConClavi commented on Sep 3, 2017

    @ConClavi
    Author

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

  2. rgfactory commented on Oct 18, 2017

    @rgfactory

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

  3. ubershmekel commented on Nov 15, 2017

    @ubershmekel

    @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.

  4. 1-0-1 commented on Nov 15, 2017

    @1-0-1

    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.

  5. ConClavi commented on Dec 20, 2017

    @ConClavi
    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.

  6. capaj commented on May 8, 2019

    @capaj

    @embryologist how does closing the issue help?

  7. ubershmekel commented on May 8, 2019

    @ubershmekel

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

  8. niftylettuce commented on Dec 5, 2019

    @niftylettuce
    Contributor

    Re-opened. We will resolve this.

  9. mmarekbb commented on Mar 15, 2022

    @mmarekbb

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

  10. zlawson-ut commented on May 7, 2022

    @zlawson-ut

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions