louiscad
02/21/2019, 10:44 AMtry registerAppInstance(info = AppInstanceInfo(
someToken = someValue
)) catch (e: HttpException) ui.showError(
when (val code = e.code()) {
503 -> ServiceUnavailableTryLater
...
else -> ...
}
)DALDEI
02/21/2019, 8:57 PMgildor
02/22/2019, 6:23 AMtry {
registerAppInstance(info = AppInstanceInfo(
someToken = someValue
))
} catch (e: HttpException) {
ui.showError(
when (val code = e.code()) {
503 -> ServiceUnavailableTryLater
...
else -> ...
}
)
}
Reads much bettergildor
02/22/2019, 6:23 AMlouiscad
02/22/2019, 6:56 AMgildor
02/22/2019, 6:57 AMlouiscad
02/22/2019, 7:02 AMgildor
02/22/2019, 7:03 AMgildor
02/22/2019, 7:04 AMif and while are different, they have expression in round brackets operator(expression) so parsing is different from trylouiscad
02/22/2019, 7:23 AMwhen on the other hand is different because the optional braces are for the branches only.gildor
02/22/2019, 8:39 AMwhile, just mistake, fixed my messagegildor
02/22/2019, 8:39 AM