mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-10 18:23:21 +08:00
d4db0737cf
Summary:
The goal is to let us see what plugins are throwing errors on Sentry.
We are using a Sentry `tag` to identify and group plugins and their
errors.
Along the way, I cleaned up the error catching and reporting system. There
was a lot of duplicate error logic (that wasn't always right) and some
legacy Atom error handling.
Now, if you catch an error that we should report (like when handling
extensions), call `NylasEnv.reportError`. This used to be called
`emitError` but I changed it to `reportError` to be consistent with the
ErrorReporter and be a bit more indicative of what it does.
In the production version, the `ErrorLogger` will forward the request to
the `nylas-private-error-reporter` which will report to Sentry.
The `reportError` function also now inspects the stack to determine which
plugin(s) it came from. These are passed along to Sentry.
I also cleaned up the `console.log` and `console.error` code. We were
logging errors multiple times making the console confusing to read. Worse
is that we were logging the `error` object, which would print not the
stack of the actual error, but rather the stack of where the console.error
was logged from. Printing `error.stack` instead shows much more accurate
stack traces.
See changes in the Edgehill repo here:
|
||
---|---|---|
.. | ||
components | ||
extensions | ||
fixtures | ||
models | ||
services | ||
stores | ||
tasks | ||
action-bridge-spec.coffee | ||
auto-update-manager-spec.coffee | ||
buffered-process-spec.coffee | ||
clipboard-spec.coffee | ||
command-installer-spec.es6 | ||
component-registry-spec.coffee | ||
database-object-registry-spec.coffee | ||
dom-utils-spec.coffee | ||
extension-registry-spec.coffee | ||
jasmine-helper.coffee | ||
jasmine-jquery.js | ||
jasmine.js | ||
launch-services-spec.coffee | ||
list-selection-spec.coffee | ||
mail-rules-processor-spec.coffee | ||
mailbox-perspective-spec.coffee | ||
menu-manager-spec.coffee | ||
module-cache-spec.coffee | ||
n1-spec-reporter.coffee | ||
nylas-api-spec.coffee | ||
nylas-env-spec.coffee | ||
nylas-protocol-handler-spec.coffee | ||
nylas-test-utils.coffee | ||
package-manager-spec.coffee | ||
package-spec.coffee | ||
quoted-html-transformer-spec.coffee | ||
quoted-plain-text-transformer-spec.coffee | ||
spec-bootstrap.coffee | ||
spec-helper-platform.coffee | ||
spec-helper.coffee | ||
spec-suite.coffee | ||
spellchecker-spec.coffee | ||
style-manager-spec.coffee | ||
styles-element-spec.coffee | ||
theme-manager-spec.coffee | ||
time-override.coffee | ||
time-reporter.coffee | ||
undo-manager-spec.coffee | ||
utils-spec.coffee |