Closed or-else closed 4 years ago
I'm not sure if it's possible to get rid of checks easily: the promise reply handler is marked throws
and the compiler requires a try-catch block.
I'm not sure if it's possible to get rid of checks easily
We could crash instead of throwing. Android crashes: throw IllegalStateException
crashes the current thread. It's a RuntimeException
which is unchecked:
https://docs.oracle.com/javase/7/docs/api/java/lang/RuntimeException.html
iOS does not have an equivalent but offers fatalError()
.
While doing this I discovered that:
https://github.com/tinode/ios/blob/master/Tinodios/AccountSettingsViewController.swift#L204
setMeta
does not throw: https://github.com/tinode/ios/blob/master/TinodeSDK/Topic.swift#L874 and even thisdo
is probably unnecessary: https://github.com/tinode/ios/blob/master/TinodeSDK/Topic.swift#L875I can fix credentials first. I can clean up number 2 as I go.