Improved error handling (try/catch).
This commit is contained in:
parent
c1a46b863c
commit
23f7fb2b1d
1 changed files with 4 additions and 7 deletions
|
@ -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
|
||||||
|
try
|
||||||
new callback(params)
|
new callback(params)
|
||||||
|
catch e
|
||||||
|
@log 'error', "route #{route}:", e
|
||||||
controller(params)
|
controller(params)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue