Files
coolify/app/Support/FtpsRequestFailed.php
033f0c84da v4.7 (#12478)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Co-authored-by: Aditya Tripathi <aditya@climactic.co>
2026-11-06 14:25:02 +01:00

28 lines
697 B
PHP

<?php
namespace App\Support;
use RuntimeException;
/**
* A failed curl request of FtpsFilesystemAdapter. The code is the curl error number.
*/
class FtpsRequestFailed extends RuntimeException
{
/**
* CURLE_REMOTE_ACCESS_DENIED (the server refused to change to the directory), CURLE_FTP_COULDNT_RETR_FILE, and
* CURLE_REMOTE_FILE_NOT_FOUND.
*/
private const NOT_FOUND_ERRORS = [9, 19, 78];
public function __construct(int $curlError, string $message)
{
parent::__construct('FTPS request failed: '.$message, $curlError);
}
public function isNotFound(): bool
{
return in_array($this->getCode(), self::NOT_FOUND_ERRORS, true);
}
}