Simplify Exception handling in NewMessage

pr/1451-ime-issues
Andrew 11 months ago
parent 922a3ce827
commit bf3835d6a6

@ -84,11 +84,12 @@ class NewMessageViewModel @Inject constructor(
_state.update { it.copy(loading = false) } _state.update { it.copy(loading = false) }
onPublicKey(onsNameOrPublicKey) onPublicKey(onsNameOrPublicKey)
} }
} catch (e: CancellationException) { } catch (e: TimeoutCancellationException) {
if (e is TimeoutCancellationException) {
// Ignore JobCancellationException, which is called when we cancel the job.
onError(e) onError(e)
} } catch (e: CancellationException) {
// Ignore JobCancellationException, which is called when we cancel the job and
// is handled where the job is canceled.
// Can't reference JobCancellationException directly, it is internal.
} catch (e: Exception) { } catch (e: Exception) {
onError(e) onError(e)
} }

Loading…
Cancel
Save