#4 Исправлена индикацие о фантомной ошибке при размонтировании устройства.
This commit is contained in:
@@ -274,7 +274,11 @@ class USBVirusScanner {
|
|||||||
|
|
||||||
currentState = SystemState.IDLE
|
currentState = SystemState.IDLE
|
||||||
|
|
||||||
} catch (e: Exception) {
|
} catch (e: kotlinx.coroutines.CancellationException) {
|
||||||
|
currentState = SystemState.IDLE
|
||||||
|
println(if (isDebug) "Программа получила CancellationException. Возврат к состоянию IDLE." else "")
|
||||||
|
}
|
||||||
|
catch (e: Exception) {
|
||||||
println(if (isDebug) "❌ Критическая ошибка: ${e.message}" else "")
|
println(if (isDebug) "❌ Критическая ошибка: ${e.message}" else "")
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
currentState = SystemState.ERROR
|
currentState = SystemState.ERROR
|
||||||
@@ -513,7 +517,7 @@ class USBVirusScanner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun shutdown() {
|
fun shutdown() {
|
||||||
println(if (isDebug) "\nЗавершение работы..." else "")
|
println(if (isDebug) "\nЗавершение работы..." else "")
|
||||||
isRunning = false
|
isRunning = false
|
||||||
@@ -649,7 +653,8 @@ fun main(args: Array<String>) {
|
|||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
println(if (isDebug) "❌ Критическая ошибка: ${e.message}" else "")
|
println(if (isDebug) "❌ Критическая ошибка: ${e.message}" else "")
|
||||||
e.printStackTrace()
|
if (isDebug) e.printStackTrace()
|
||||||
|
if (isDebug) println("Общий Exception")
|
||||||
scanner.shutdown()
|
scanner.shutdown()
|
||||||
exitProcess(1)
|
exitProcess(1)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user