From b7cd8db139b2165b23efab92546cfcbe35cbcd9d Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Thu, 4 Apr 2013 15:18:54 -0400 Subject: [PATCH] Small code cleanup (imported from commit d9f09e5a9b33be0b23ddae072a3021bb01a3de3e) --- zephyr/static/js/blueslip.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/zephyr/static/js/blueslip.js b/zephyr/static/js/blueslip.js index 90cdaabd86..88ebddd08a 100644 --- a/zephyr/static/js/blueslip.js +++ b/zephyr/static/js/blueslip.js @@ -92,21 +92,21 @@ exports.wrap_function = function blueslip_wrap_function(func) { var new_func = function blueslip_wrapper() { if (page_params.debug_mode) { return func.apply(this, arguments); - } else { - try { - return func.apply(this, arguments); - } catch (ex) { - // Treat exceptions like a call to fatal() - var message = ex.message; - if (ex.hasOwnProperty('fileName')) { - message += " at " + ex.fileName; - if (ex.hasOwnProperty('lineNumber')) { - message += ":" + ex.lineNumber; - } + } + + try { + return func.apply(this, arguments); + } catch (ex) { + // Treat exceptions like a call to fatal() + var message = ex.message; + if (ex.hasOwnProperty('fileName')) { + message += " at " + ex.fileName; + if (ex.hasOwnProperty('lineNumber')) { + message += ":" + ex.lineNumber; } - report_error(message, ex.stack, {show_ui_msg: true}); - throw ex; } + report_error(message, ex.stack, {show_ui_msg: true}); + throw ex; } }; func.blueslip_wrapper = new_func;