mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Handle all exceptions are thrown by prediction calculating
GitOrigin-RevId: 9a881a16ccc42446b3ce7c53e93390f36c98a296
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dcf205bf0d
commit
ba4dd580a3
+8
-6
@@ -30,19 +30,21 @@ internal abstract class PredictionController(private val project: Project,
|
||||
val task: Task.Backgroundable = object : Task.Backgroundable(project, "ChangeReminder Prediction Calculating") {
|
||||
override fun run(indicator: ProgressIndicator) {
|
||||
inProgress = true
|
||||
val result = mutableListOf<FilePath>()
|
||||
try {
|
||||
val request = popRequest() ?: let {
|
||||
complete(emptyList())
|
||||
return
|
||||
}
|
||||
val request = popRequest() ?: return
|
||||
val (time, prediction) = measureSupplierTimeMillis { request.calculate() }
|
||||
logEvent(project, ChangeReminderEvent.PREDICTION_CALCULATED, ChangeReminderData.EXECUTION_TIME, time)
|
||||
complete(prediction)
|
||||
result.addAll(prediction)
|
||||
}
|
||||
catch (e: ProcessCanceledException) {
|
||||
complete(emptyList())
|
||||
throw e
|
||||
}
|
||||
catch (_: Exception) {
|
||||
}
|
||||
finally {
|
||||
complete(result)
|
||||
}
|
||||
}
|
||||
}
|
||||
val indicator = EmptyProgressIndicator()
|
||||
|
||||
Reference in New Issue
Block a user