From 65fff12f5517c663bd175c4c2831f39f64e72918 Mon Sep 17 00:00:00 2001 From: jscampucci Date: Wed, 10 Jul 2024 09:33:59 +0200 Subject: [PATCH] [error] clean error --- lib/services/download.dart | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/services/download.dart b/lib/services/download.dart index 536cc02..f21e8e3 100644 --- a/lib/services/download.dart +++ b/lib/services/download.dart @@ -129,12 +129,21 @@ class DLServices { error, stackTrace, ) { - error.map((e) { - debugPrint('Analyse result: $e'); - FileLogger().d('Analyse result: ${e.toString()}'); - FileLogger().d('stdout: ${e.stdout}'); - FileLogger().d('stderr: ${e.stderr}'); - }); + if (error is ShellException) { + debugPrint('ShellException: ${error.message}'); + FileLogger().e('ShellException: ${error.message}'); + } else { + debugPrint('Error: $error'); + FileLogger().e('Error: $error'); + } + if (error.map) { + error.map((e) { + debugPrint('Analyse result: $e'); + FileLogger().d('Analyse result: ${e.toString()}'); + FileLogger().d('stdout: ${e.stdout}'); + FileLogger().d('stderr: ${e.stderr}'); + }); + } }); return shellLinesController.stream;