Skip to content
Snippets Groups Projects
Verified Commit 3d112b91 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fix bug where a properly closed connection was marked as errored

parent 0a10830f
No related branches found
No related tags found
No related merge requests found
Pipeline #281 passed
...@@ -229,6 +229,8 @@ class CoreConnection( ...@@ -229,6 +229,8 @@ class CoreConnection(
} }
channel?.close() channel?.close()
} catch (e: Throwable) { } catch (e: Throwable) {
val closed = state.value == ConnectionState.CLOSED
var cause: Throwable? = e var cause: Throwable? = e
var exception: QuasselSecurityException? var exception: QuasselSecurityException?
do { do {
...@@ -239,11 +241,13 @@ class CoreConnection( ...@@ -239,11 +241,13 @@ class CoreConnection(
close() close()
securityExceptionCallback(exception) securityExceptionCallback(exception)
} else { } else {
if (!closed) {
log(WARN, TAG, "Error encountered in connection", e) log(WARN, TAG, "Error encountered in connection", e)
log(WARN, TAG, "Last sent message: ${MessageRunnable.lastSent.get()}") log(WARN, TAG, "Last sent message: ${MessageRunnable.lastSent.get()}")
close()
exceptionCallback(e) exceptionCallback(e)
} }
close()
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment