File tree 3 files changed +7
-4
lines changed
android/app/src/main/java/com/enderchat/modules/connection
3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ import javax.crypto.Cipher
18
18
import javax.crypto.spec.IvParameterSpec
19
19
import javax.crypto.spec.SecretKeySpec
20
20
import kotlin.concurrent.read
21
- import kotlin.concurrent.thread
22
21
import kotlin.concurrent.write
23
22
24
23
class ConnectionModule (reactContext : ReactApplicationContext )
@@ -291,9 +290,9 @@ class ConnectionModule(reactContext: ReactApplicationContext)
291
290
// Remove upstream listeners, stop unnecessary background tasks
292
291
}
293
292
294
- private fun println (log : Any? ) {
293
+ /* private fun println(log: Any?) {
295
294
sendEvent(reactContext = reactApplicationContext, "ecm:log", Arguments.createMap().apply {
296
295
putString("log", log.toString())
297
296
})
298
- }
297
+ } */
299
298
}
Original file line number Diff line number Diff line change @@ -113,7 +113,10 @@ const initiateJavaScriptConnection = async (opts: ConnectionOptions) => {
113
113
} )
114
114
socket . on ( 'error' , err => {
115
115
if ( ! resolved ) reject ( err )
116
- else conn . emit ( 'error' , err )
116
+ else {
117
+ conn . disconnectReason = err . message
118
+ conn . emit ( 'error' , err )
119
+ }
117
120
} )
118
121
const lock = new Semaphore ( 1 )
119
122
socket . on ( 'data' , newData => {
Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ export class NativeServerConnection
125
125
this . eventEmitter . addListener ( 'ecm:error' , ( event : NativeErrorEvent ) => {
126
126
if ( event . connectionId !== this . id ) return
127
127
console . error ( event . stackTrace )
128
+ this . disconnectReason = event . message
128
129
this . emit ( 'error' , new Error ( event . message ) )
129
130
} )
130
131
this . eventEmitter . addListener ( 'ecm:close' , ( event : NativeEvent ) => {
You can’t perform that action at this time.
0 commit comments