forked from thephpleague/flysystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use exceptions for connection root error resolving
- Loading branch information
1 parent
aa7119c
commit f3a9e41
Showing
6 changed files
with
109 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace League\Flysystem\Ftp; | ||
|
||
use RuntimeException; | ||
use Throwable; | ||
|
||
final class UnableToResolveConnectionRoot extends RuntimeException implements FtpConnectionException | ||
{ | ||
private function __construct(string $message, Throwable $previous = null) | ||
{ | ||
parent::__construct($message, 0, $previous); | ||
} | ||
|
||
public static function itDoesNotExist(string $root): UnableToResolveConnectionRoot | ||
{ | ||
return new UnableToResolveConnectionRoot( | ||
'Unable to resolve connection root. It does not seem to exist: ' . $root | ||
); | ||
} | ||
|
||
public static function couldNotGetCurrentDirectory(string $message = ''): UnableToResolveConnectionRoot | ||
{ | ||
return new UnableToResolveConnectionRoot( | ||
'Unable to resolve connection root. Could not resolve the current directory. ' . $message | ||
); | ||
} | ||
} |