Skip to content

Commit 5a7db86

Browse files
committed
Better exception
1 parent a48680c commit 5a7db86

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/SPC/store/Downloader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,10 @@ public static function curlExec(string $url, string $method = 'GET', array $head
537537
}
538538
f_exec($cmd, $output, $ret);
539539
if ($ret === 2 || $ret === -1073741510) {
540-
throw new RuntimeException('failed http fetch');
540+
throw new RuntimeException(sprintf('Failed to fetch "%s"', $url));
541541
}
542542
if ($ret !== 0) {
543-
throw new DownloaderException('failed http fetch');
543+
throw new DownloaderException(sprintf('Failed to fetch "%s"', $url));
544544
}
545545
$cache[$cmd]['cache'] = implode("\n", $output);
546546
$cache[$cmd]['expire'] = time() + 3600;
@@ -549,10 +549,10 @@ public static function curlExec(string $url, string $method = 'GET', array $head
549549
}
550550
f_exec($cmd, $output, $ret);
551551
if ($ret === 2 || $ret === -1073741510) {
552-
throw new RuntimeException('failed http fetch');
552+
throw new RuntimeException(sprintf('Failed to fetch "%s"', $url));
553553
}
554554
if ($ret !== 0) {
555-
throw new DownloaderException('failed http fetch');
555+
throw new DownloaderException(sprintf('Failed to fetch "%s"', $url));
556556
}
557557
return implode("\n", $output);
558558
}

0 commit comments

Comments
 (0)