mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 05:14:52 +08:00
Better exception
This commit is contained in:
parent
a48680c26f
commit
5a7db86471
@ -537,10 +537,10 @@ class Downloader
|
|||||||
}
|
}
|
||||||
f_exec($cmd, $output, $ret);
|
f_exec($cmd, $output, $ret);
|
||||||
if ($ret === 2 || $ret === -1073741510) {
|
if ($ret === 2 || $ret === -1073741510) {
|
||||||
throw new RuntimeException('failed http fetch');
|
throw new RuntimeException(sprintf('Failed to fetch "%s"', $url));
|
||||||
}
|
}
|
||||||
if ($ret !== 0) {
|
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]['cache'] = implode("\n", $output);
|
||||||
$cache[$cmd]['expire'] = time() + 3600;
|
$cache[$cmd]['expire'] = time() + 3600;
|
||||||
@ -549,10 +549,10 @@ class Downloader
|
|||||||
}
|
}
|
||||||
f_exec($cmd, $output, $ret);
|
f_exec($cmd, $output, $ret);
|
||||||
if ($ret === 2 || $ret === -1073741510) {
|
if ($ret === 2 || $ret === -1073741510) {
|
||||||
throw new RuntimeException('failed http fetch');
|
throw new RuntimeException(sprintf('Failed to fetch "%s"', $url));
|
||||||
}
|
}
|
||||||
if ($ret !== 0) {
|
if ($ret !== 0) {
|
||||||
throw new DownloaderException('failed http fetch');
|
throw new DownloaderException(sprintf('Failed to fetch "%s"', $url));
|
||||||
}
|
}
|
||||||
return implode("\n", $output);
|
return implode("\n", $output);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user