Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Handled/unhandled payload properties #116

Merged
merged 8 commits into from
Oct 2, 2017
Merged

Conversation

bengourley
Copy link
Contributor

Note this PR is based off of #115 since that is one of the main cases which requires unhandled info.

In order to support the upcoming handled/unhandled product feature this PR ensures that the following properties are set in the events[] property of the payload:

  • unhandled
  • defaultSeverity
  • severityReason

Since these properties are meant to be inferred and set internally by the notifier, but all internal usage went via Bugsnag.notify(), I extracted the contents of that function into one that is private (ie. within this module's scope only). The private function contains an additional argument handledState which cannot be set by the user, and when the public Bugsnag.notify() is called, values are inferred for handledState based on what was supplied.

There are a couple grey areas where functionality provided by this module is appeared at first to be "unhandled" and needed a severityReason etc.: Bugsnag.intercept(), Bugsnag.autoNotify(). In these instances, the captured errors are reported to via Bugsnag.notify() and therefore get handledState values applied as if the user had called the public function themselves.

(N.B. the Bugsnag.autoNotify() function is subtly different to the autoNotify option. Uncaught exceptions/promises will be reported as unhandled=true with severity="error" and the relevant severityReason.)

@bengourley bengourley changed the title Handled unhandled Handled/unhandled payload properties Sep 8, 2017
@coveralls
Copy link

coveralls commented Sep 8, 2017

Coverage Status

Coverage increased (+3.5%) to 78.762% when pulling 3d97df2 on handled-unhandled into a4bfeba on master.

Also detects if any callback changed "severity" and update
"defaultSeverity" accordingly.
@coveralls
Copy link

coveralls commented Sep 8, 2017

Coverage Status

Coverage increased (+3.7%) to 78.966% when pulling c042167 on handled-unhandled into a4bfeba on master.

@bengourley bengourley requested a review from kattrali September 8, 2017 14:46
@bengourley bengourley merged commit de9d65f into master Oct 2, 2017
@bengourley bengourley deleted the handled-unhandled branch October 23, 2017 10:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants