Open bz2 opened 6 years ago
Thanks for your contributions. They look good to me. I will be reviewing the changes within the next days.
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.
I created a new release with all your existing improvements.
Thanks a lot for your contributions!
@steren Thanks! Will update our code to use latest version and some of the new interfaces.
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 acallback
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).report()
andsendErrorPayload()
#50payload
(or justpayload.message
) when promise is fulfilled #59console.log
#6When calling
report()
directly from a logging framework, stacktraces for strings currently start inside the logger rather than at the caller.firstFrameIndex
as an argument toreport()
#58Build 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.
npm start
launch the demo in a browser window #52