Skip to content

Proposed API and build improvements #45

Open

Description

@bz2

Thanks for publishing this library, have been using it a quite heavily over the last few months to record frontend errors in the same place as we track backend problems. Out of this, I'd like to submit some improvements, some of which may require some discussion and decisions, so this is a meta issue for tracking the proposed changes.

Library API

Currently StackdriverErrorReporter exposes a callback parameter in a few places, mostly to enable the testing. This allows some errors to be seen by callers, but does not expose the extracted stacktrace message and is somewhat awkward to use. As stacktrace-js already uses promises, I suggest the interface here should too. The promise api is widely available and there's a polyfill bundled in the build already (though this may want some tweaking, see below).

When calling report() directly from a logging framework, stacktraces for strings currently start inside the logger rather than at the caller.

Build and packaging

This is a simple library and doesn't need a complicated build, but there are a few niggles currently when embedding in a modern webapp, and the single file bundle could also been improved. Not sure how far to go on this front, but there are some simple improvements to make at least.

Activity

  1. steren commented on Nov 20, 2018

    @steren
    Contributor

    Thanks for your contributions. They look good to me.
    I will be reviewing the changes within the next days.

  2. bz2 commented on Nov 21, 2018

    @bz2
    ContributorAuthor

    Thank you very much for review and landing so far!

    Will put the next batch up for consideration later.

    Main things to resolve are what specifically report() should resolve and reject into, and how to produce both a simple ES5 compatible bundled file and a clean module interface.

  3. steren commented on Jun 2, 2019

    @steren
    Contributor

    I created a new release with all your existing improvements.

    Thanks a lot for your contributions!

  4. bz2 commented on Jun 3, 2019

    @bz2
    ContributorAuthor

    @steren Thanks! Will update our code to use latest version and some of the new interfaces.

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