From 52a623f31e9e0b8ac7d0f1755e7acc5f08ac39e8 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Thu, 24 Jul 2025 12:00:17 +0800 Subject: [PATCH] Suggestions --- src/SPC/command/DownloadCommand.php | 3 +-- src/SPC/store/PackageManager.php | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/SPC/command/DownloadCommand.php b/src/SPC/command/DownloadCommand.php index c1b0903a..dfa4c9ee 100644 --- a/src/SPC/command/DownloadCommand.php +++ b/src/SPC/command/DownloadCommand.php @@ -250,8 +250,7 @@ class DownloadCommand extends BaseCommand logger()->warning("No alternative sources found for {$source}, using default alternative source"); $alt_config = array_merge($config, Downloader::getDefaultAlternativeSource($source)); } elseif ($alt_sources === false) { - logger()->error("No alternative sources found for {$source}, skipping alternative download"); - throw $e; + throw new DownloaderException("No alternative sources found for {$source}, skipping alternative download"); } else { logger()->notice("Trying to download alternative sources for {$source}"); $alt_config = array_merge($config, $alt_sources); diff --git a/src/SPC/store/PackageManager.php b/src/SPC/store/PackageManager.php index 14f6bbcf..dc662a5b 100644 --- a/src/SPC/store/PackageManager.php +++ b/src/SPC/store/PackageManager.php @@ -37,7 +37,6 @@ class PackageManager Downloader::downloadPackage($pkg_name, $config, $force); } catch (\Throwable $e) { if (!$allow_alt) { - logger()->error("Download package {$pkg_name} failed: " . $e->getMessage()); throw new DownloaderException("Download package {$pkg_name} failed: " . $e->getMessage()); } // if download failed, we will try to download alternative packages