File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -98,9 +98,16 @@ export default Service.extend({
98
98
async initialize ( ) {
99
99
if ( this . get ( 'session.isAuthenticated' ) ) {
100
100
if ( this . get ( 'session.data.currentUserFallback.id' ) ) {
101
- const user = await this . store . findRecord ( 'user' , this . get ( 'session.data.currentUserFallback.id' ) ) ;
102
- this . set ( 'currentUserModel' , user ) ;
103
- this . identify ( ) ;
101
+ try {
102
+ const user = await this . store . findRecord ( 'user' , this . get ( 'session.data.currentUserFallback.id' ) ) ;
103
+ this . set ( 'currentUserModel' , user ) ;
104
+ this . identify ( ) ;
105
+ } catch ( e ) {
106
+ console . warn ( e ) ;
107
+ this . session . invalidate ( ) ;
108
+ this . notify . error ( this . l10n . t ( 'An unexpected error has occurred' ) ) ;
109
+ }
110
+
104
111
} else {
105
112
this . identifyStranger ( ) ;
106
113
}
You can’t perform that action at this time.
0 commit comments