Almost 404 handling, but failt on application load, therefore current error fallback is better thant the handling of it

This commit is contained in:
2018-02-05 10:43:57 -03:00
parent ec47493166
commit ac8aabd302
+6 -1
View File
@@ -23,7 +23,7 @@ export default Ember.Mixin.create ApplicationRouteMixin,
@transitionTo('login')
actions:
error: (error) ->
error: (error, maybeTransition) ->
return unless @connections?.length # cannot use outlet at this moment
console.log error
container = Ember.getOwner(@)
@@ -33,6 +33,11 @@ export default Ember.Mixin.create ApplicationRouteMixin,
@set 'router.globals.current_user', null
@transitionTo 'login'
return
#when 404
# # nothing for now apparently
# #maybeTransition?.abort?()
# #@transitionTo 'four-oh-four'
# #return
controller = container.lookup "component:error-handling"
return unless controller?.set
controller.set 'error', error