Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add path not exists exception which specifies the path #41

Open
wants to merge 5 commits into
base: 2.x
Choose a base branch
from

Conversation

dantleech
Copy link
Sponsor

@dantleech dantleech commented Apr 13, 2020

Specify the path which doesn't exist when the path doesn't exist.

I can't test this locally as I don't have the necessary extensions (eio, uv) to install the dev dependencies. I manually deleted the extension deps from composer.

Looks like you also need to update Travis - the legacy integrations have broken.. (you can migrate here )

Specify the path which doesn't exist when the path doesn't exist.
Comment on lines 7 to 13
class PathDoesNotExistException extends FileSystemException
{
public function __construct(string $path)
{
parent::__construct(sprintf('Specified path "%s" does not exist', $path));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend also adding a getter for the path. It might help custom exception handling.

@dantleech
Copy link
Sponsor Author

dantleech commented Apr 13, 2020

There doesn't seem to be any tests for path not exists - and I think it should be consistent across drivers, so could do:

  • Add tests for "not exists" to the driver test case and update all the other implementations
  • OR
  • Remove the custom exception and just add a factory method for the exception in ParallelDriver


namespace Amp\File;

class PathDoesNotExistException extends FilesystemException
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe FileNotFoundException?

@enumag
Copy link
Contributor

enumag commented Apr 13, 2020

Shouldn't you update all drivers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants