Skip to content

Commit 7fd858b

Browse files
committed
Revert "unwrap cast to unify curlDown with curlExec"
This reverts commit 74d8377.
1 parent 74d8377 commit 7fd858b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/SPC/store/Downloader.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,14 @@ public static function curlDown(string $url, string $path, string $method = 'GET
573573
$check = !defined('DEBUG_MODE') ? 's' : '#';
574574
$retry = $retries > 0 ? "--retry {$retries}" : '';
575575
$cmd = SPC_CURL_EXEC . " -{$check}fSL {$retry} -o \"{$path}\" {$methodArg} {$headerArg} \"{$url}\"";
576-
f_passthru($cmd);
576+
try {
577+
f_passthru($cmd);
578+
} catch (RuntimeException $e) {
579+
if ($e->getCode() === 2 || $e->getCode() === -1073741510) {
580+
throw new WrongUsageException('Keyboard interrupted, download failed !');
581+
}
582+
throw $e;
583+
}
577584
}
578585

579586
public static function getPreBuiltLockName(string $source): string

0 commit comments

Comments
 (0)