changed conditional style to easier to read/maintain when (like switch) statement
This commit is contained in:
@@ -211,10 +211,12 @@ internal class ImapConnectionCache(
|
||||
// FolderClosedException/StoreClosedException are themselves MessagingException subtypes, so these
|
||||
// definite-drop checks must run before the MessagingException guard below — otherwise they'd fall
|
||||
// into it and get gated on a `.cause` they don't carry, instead of the unconditional `true` below.
|
||||
if (error is FolderClosedException || error is StoreClosedException) return true
|
||||
if (error is IOException || error is ConnectionException) return true
|
||||
if (error !is MessagingException) return false
|
||||
return error.cause is IOException || error.cause is ConnectionException
|
||||
when {
|
||||
error is FolderClosedException || error is StoreClosedException -> return true
|
||||
error is IOException || error is ConnectionException -> return true
|
||||
error !is MessagingException -> return false
|
||||
else -> return error.cause is IOException || error.cause is ConnectionException
|
||||
}
|
||||
}
|
||||
|
||||
private companion object {
|
||||
|
||||
Reference in New Issue
Block a user