blueslip: Only show in dev mode, or report to Sentry.

This removes the production reporting to `/json/report/error` upon
`blueslip.error`, and replaces it with reporting to Sentry, if
enabled.  Sentry provides better reporting and grouping for exceptions
than the email- and `#errors`-reporting provided by the
`/json/report/error` endpoint.

The development behaviour of rendering `blueslip.error` messages and
stacktraces immediately, and stopping execution, is preserved.

To better chain exception information, the whole previous exception is
passed to `blueslip.error`, not just the stack, and the second
parameter is formalized to be an object to map to Sentry's "context"
concept.
This commit is contained in:
Alex Vandiver
2023-03-29 17:07:36 +00:00
committed by Tim Abbott
parent f9f7c7b114
commit 2d5c678614
14 changed files with 119 additions and 191 deletions

View File

@@ -228,7 +228,7 @@ function do_reload_app(send_after_reload, save_pointer, save_narrow, save_compos
try {
preserve_state(send_after_reload, save_pointer, save_narrow, save_compose);
} catch (error) {
blueslip.error("Failed to preserve state", undefined, error.stack);
blueslip.error("Failed to preserve state", undefined, error);
}
}
@@ -257,7 +257,7 @@ function do_reload_app(send_after_reload, save_pointer, save_narrow, save_compos
try {
server_events.cleanup_event_queue();
} catch (error) {
blueslip.error("Failed to clean up before reloading", undefined, error.stack);
blueslip.error("Failed to clean up before reloading", undefined, error);
}
window.location.reload(true);