diff --git a/src/Composer/Downloader/TransportException.php b/src/Composer/Downloader/TransportException.php index c91897c1c..5ab5ca6f3 100644 --- a/src/Composer/Downloader/TransportException.php +++ b/src/Composer/Downloader/TransportException.php @@ -26,6 +26,11 @@ class TransportException extends \RuntimeException /** @var array */ protected $responseInfo = []; + public function __construct(string $message = "", int $code = 400, \Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } + /** * @param array $headers */ diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 5d7e7fb51..32a149856 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -80,6 +80,8 @@ class Installer // used/declared in SolverProblemsException, carried over here for completeness public const ERROR_DEPENDENCY_RESOLUTION_FAILED = 2; public const ERROR_AUDIT_FAILED = 5; + // technically exceptions are thrown with various status codes >400, but the process exit code is normalized to 255 + public const ERROR_TRANSPORT_EXCEPTION = 255; /** * @var IOInterface