You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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.
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.
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()
Return a Promise from report method #50payload
(or justpayload.message
) when promise is fulfilled Give clear results when report promise completes #59console.log
Unhandled exception should still be printed to the Console #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()
Add option to skip more frames using report #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 Show demo in browser on npm start #52The text was updated successfully, but these errors were encountered: