From 23f7fb2b1d0aeabb79ffead077a58f386c8afdfb Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 31 Aug 2016 19:06:32 +0200 Subject: [PATCH] Improved error handling (try/catch). --- .../app/lib/app_post/interface_handle.coffee | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/interface_handle.coffee b/app/assets/javascripts/app/lib/app_post/interface_handle.coffee index 69c464792..00968ac55 100644 --- a/app/assets/javascripts/app/lib/app_post/interface_handle.coffee +++ b/app/assets/javascripts/app/lib/app_post/interface_handle.coffee @@ -75,12 +75,6 @@ class App.Content extends App.ControllerWidgetPermanent @el.unbind() @el.undelegate() - # send current controller - params_only = {} - for i of params - if typeof params[i] isnt 'object' - params_only[i] = params[i] - # remember history # needed to mute "redirect" url to support browser back history = App.Config.get('History') @@ -91,7 +85,10 @@ class App.Content extends App.ControllerWidgetPermanent # execute controller controller = (params) => params.el = @el - new callback(params) + try + new callback(params) + catch e + @log 'error', "route #{route}:", e controller(params) )