From 71e14674aaa71b74b81dd691abd5328c116f3520 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Mon, 10 Jun 2013 17:47:22 -0400 Subject: [PATCH] Be more judicious in our showing of errors Don't show an error banner for any uncaught JS exception, as often the app will continue to work fine, and there's no way to dismiss it other than reloading the page. Also, don't show a transient "could not connect to humbug" error if the check-for-messages-in-narrow request fails. (imported from commit 2c634ba088b58c17fa5b2e3353b0589d40b8e357) --- zephyr/static/js/blueslip.js | 5 ++--- zephyr/static/js/zephyr.js | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/zephyr/static/js/blueslip.js b/zephyr/static/js/blueslip.js index 16c48d9bb3..236abbcc3a 100644 --- a/zephyr/static/js/blueslip.js +++ b/zephyr/static/js/blueslip.js @@ -127,7 +127,7 @@ exports.wrap_function = function blueslip_wrap_function(func) { message += ":" + ex.lineNumber; } } - report_error(message, ex.stack, {show_ui_msg: true}); + report_error(message, ex.stack); throw ex; } }; @@ -288,8 +288,7 @@ exports.error = function blueslip_error (msg, more_info) { exports.fatal = function blueslip_fatal (msg, more_info) { if (! page_params.debug_mode) { - report_error(msg, Error().stack, {show_ui_msg: true, - more_info: more_info}); + report_error(msg, Error().stack, {more_info: more_info}); } throw new BlueslipError(msg, more_info); diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index 8f884a1dd9..aae6adc734 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -729,7 +729,6 @@ function maybe_add_narrowed_messages(messages, msg_list) { }, error: function (xhr) { // We might want to be more clever here - $('#connection-error').show(); setTimeout(function () { if (msg_list === current_msg_list) { // Don't actually try again if we unnarrowed