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.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
|
||||
try
|
||||
new callback(params)
|
||||
catch e
|
||||
@log 'error', "route #{route}:", e
|
||||
controller(params)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue