File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
android/app/src/main/java/com/enderchat/modules/connection Expand file tree Collapse file tree 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
1818import javax.crypto.spec.IvParameterSpec
1919import javax.crypto.spec.SecretKeySpec
2020import kotlin.concurrent.read
21- import kotlin.concurrent.thread
2221import kotlin.concurrent.write
2322
2423class ConnectionModule (reactContext : ReactApplicationContext )
@@ -291,9 +290,9 @@ class ConnectionModule(reactContext: ReactApplicationContext)
291290 // Remove upstream listeners, stop unnecessary background tasks
292291 }
293292
294- private fun println (log : Any? ) {
293+ /* private fun println(log: Any?) {
295294 sendEvent(reactContext = reactApplicationContext, "ecm:log", Arguments.createMap().apply {
296295 putString("log", log.toString())
297296 })
298- }
297+ } */
299298}
Original file line number Diff line number Diff line change @@ -113,7 +113,10 @@ const initiateJavaScriptConnection = async (opts: ConnectionOptions) => {
113113 } )
114114 socket . on ( 'error' , err => {
115115 if ( ! resolved ) reject ( err )
116- else conn . emit ( 'error' , err )
116+ else {
117+ conn . disconnectReason = err . message
118+ conn . emit ( 'error' , err )
119+ }
117120 } )
118121 const lock = new Semaphore ( 1 )
119122 socket . on ( 'data' , newData => {
Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ export class NativeServerConnection
125125 this . eventEmitter . addListener ( 'ecm:error' , ( event : NativeErrorEvent ) => {
126126 if ( event . connectionId !== this . id ) return
127127 console . error ( event . stackTrace )
128+ this . disconnectReason = event . message
128129 this . emit ( 'error' , new Error ( event . message ) )
129130 } )
130131 this . eventEmitter . addListener ( 'ecm:close' , ( event : NativeEvent ) => {
You can’t perform that action at this time.
0 commit comments