Merge pull request #760 from lyrixx/better-exception

Better exception
This commit is contained in:
Marc
2025-06-12 12:10:20 +07:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -537,10 +537,10 @@ class Downloader
}
f_exec($cmd, $output, $ret);
if ($ret === 2 || $ret === -1073741510) {
throw new RuntimeException('failed http fetch');
throw new RuntimeException(sprintf('Failed to fetch "%s"', $url));
}
if ($ret !== 0) {
throw new DownloaderException('failed http fetch');
throw new DownloaderException(sprintf('Failed to fetch "%s"', $url));
}
$cache[$cmd]['cache'] = implode("\n", $output);
$cache[$cmd]['expire'] = time() + 3600;
@@ -549,10 +549,10 @@ class Downloader
}
f_exec($cmd, $output, $ret);
if ($ret === 2 || $ret === -1073741510) {
throw new RuntimeException('failed http fetch');
throw new RuntimeException(sprintf('Failed to fetch "%s"', $url));
}
if ($ret !== 0) {
throw new DownloaderException('failed http fetch');
throw new DownloaderException(sprintf('Failed to fetch "%s"', $url));
}
return implode("\n", $output);
}