Commit a17475a 1 parent 362eee4 commit a17475a Copy full SHA for a17475a
File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -77,16 +77,15 @@ export async function loginCharacter(options: {
77
77
// Select character to play and get back game credentials
78
78
const credentials = await getGameCredentials ( { socket, characterName } ) ;
79
79
80
- socket . end ( ) ;
81
-
82
80
return {
83
81
subscription,
84
82
credentials,
85
83
} ;
86
84
} catch ( error ) {
87
85
logger . error ( 'error logging in' , { error } ) ;
88
- socket . destroy ( ) ;
89
86
throw error ;
87
+ } finally {
88
+ socket . destroySoon ( ) ;
90
89
}
91
90
}
92
91
@@ -135,13 +134,12 @@ export async function listCharacters(options: {
135
134
// Retrieve list of characters available to the account
136
135
const characters = await listAvailableCharacters ( { socket } ) ;
137
136
138
- socket . end ( ) ;
139
-
140
137
return characters ;
141
138
} catch ( error ) {
142
139
logger . error ( 'error listing characters' , { error } ) ;
143
- socket . destroy ( ) ;
144
140
throw error ;
141
+ } finally {
142
+ socket . destroySoon ( ) ;
145
143
}
146
144
}
147
145
You can’t perform that action at this time.
0 commit comments