Improved error handling (try/catch).

This commit is contained in:
Martin Edenhofer 2016-08-31 19:06:32 +02:00
parent c1a46b863c
commit 23f7fb2b1d

View file

@ -75,12 +75,6 @@ class App.Content extends App.ControllerWidgetPermanent
@el.unbind() @el.unbind()
@el.undelegate() @el.undelegate()
# send current controller
params_only = {}
for i of params
if typeof params[i] isnt 'object'
params_only[i] = params[i]
# remember history # remember history
# needed to mute "redirect" url to support browser back # needed to mute "redirect" url to support browser back
history = App.Config.get('History') history = App.Config.get('History')
@ -91,7 +85,10 @@ class App.Content extends App.ControllerWidgetPermanent
# execute controller # execute controller
controller = (params) => controller = (params) =>
params.el = @el params.el = @el
new callback(params) try
new callback(params)
catch e
@log 'error', "route #{route}:", e
controller(params) controller(params)
) )