diff --git a/lib/providers/download_provider.dart b/lib/providers/download_provider.dart index 5842f14..a39d12a 100644 --- a/lib/providers/download_provider.dart +++ b/lib/providers/download_provider.dart @@ -57,7 +57,8 @@ class DownloadProvider extends ChangeNotifier { return Response(requestOptions: RequestOptions(path: url)); } else { _cancelToken?.cancel(); - throw e; + final errorMessage = e is DioException ? e.message : 'An unknown error occurred'; + throw Exception('Download failed for $url: $errorMessage'); } }).then((_) => state.done); promises.add(promise);