-
Notifications
You must be signed in to change notification settings - Fork 241
ДЗ #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
ДЗ #262
Conversation
|
|
||
|
|
||
| sealed class Result { | ||
| data class Success(val catData: Cat) : Result() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success по условиям задачи должен быть дженериком
| private val exceptionHandler = CoroutineExceptionHandler { _, e -> | ||
| CrashMonitor.trackWarning("${e.message}") | ||
| _uiState.value = Result.Error( | ||
| Throwable() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут потеряется исходная ошибка, можно использовать e
| // try { | ||
| // val fact = async { catsService.getCatFact() }.await() | ||
| // val catImages:List<CatImage> = async { catsImagesService.getCatImage() }.await() | ||
| // _catsView?.populate(fact, catImages.first()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не стыкуются типы, во вью populate принимает Cat
| // } | ||
| // if (ex is CancellationException) throw ex | ||
| // | ||
| // CrashMonitor.trackWarning("Error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
по условиям задачи в CrashMonitor не должны попадать SocketTimeoutException, здесь попадет, плюс не будет тоста по другим эксепшенам, кроме SocketTimeoutException
В остальных случаях логируем исключение в otus.homework.coroutines.CrashMonitor и показываем Toast с exception.message
No description provided.