mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
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>
28 lines
697 B
PHP
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);
|
|
}
|
|
}
|