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

[Finder] Throw a dedicated exception for non-existing directory #30744

Merged
merged 1 commit into from Mar 30, 2019

Conversation

Projects
None yet
4 participants
@xelan
Copy link
Contributor

commented Mar 28, 2019

Q A
Branch? master
Bug fix? yes [1]
New feature? yes
BC breaks? no
Deprecations? no [2]
Tests pass? yes
Fixed tickets #30723
License MIT
Doc PR N/A [3]

Makes Finder::in() throw a DirectoryNotFoundException instead of an InvalidArgumentException if one of the directories is not found.
This behavior is more consistent with the AccessDeniedException for files which are unreadable due to insufficient permissions.
To keep backward compatibility, the new exception class inherits from InvalidArgumentException.

[1] A valid, but non-existent directory name is IMHO not an invalid argument
[2] However, it may be semantically better to extend from RuntimeException, This would require a deprecation.
[3] Possible exceptions are currently not explained at https://symfony.com/doc/current/components/finder.html

Throw a dedicated exception for non-existing directory
Makes Finder::in() throw a DirectoryNotFoundException instead of an InvalidArgumentException if one of the directories is not found.
This behavior is more consistent with the AccessDeniedException for files which are unreadable due to insufficient permissions.
To keep BC, the new exception class inherits from InvalidArgumentException.

@nicolas-grekas nicolas-grekas added this to the next milestone Mar 28, 2019

@fabpot

fabpot approved these changes Mar 29, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Mar 30, 2019

Thank you @xelan.

@fabpot fabpot merged commit 48d5f94 into symfony:master Mar 30, 2019

1 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Mar 30, 2019

feature #30744 [Finder] Throw a dedicated exception for non-existing …
…directory (xelan)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Finder] Throw a dedicated exception for non-existing directory

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes [1]
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no [2]
| Tests pass?   | yes
| Fixed tickets | #30723
| License       | MIT
| Doc PR        | N/A [3]

Makes `Finder::in()` throw a `DirectoryNotFoundException` instead of an `InvalidArgumentException` if one of the directories is not found.
This behavior is more consistent with the `AccessDeniedException` for files which are unreadable due to insufficient permissions.
To keep backward compatibility, the new exception class inherits from `InvalidArgumentException`.

[1] A valid, but non-existent directory name is IMHO not an invalid argument
[2] However, it may be semantically better to extend from `RuntimeException`,  This would require a deprecation.
[3] Possible exceptions are currently not explained at https://symfony.com/doc/current/components/finder.html

Commits
-------

48d5f94 Throw a dedicated exception for non-existing directory

@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019

@fabpot fabpot referenced this pull request May 9, 2019

Merged

Release v4.3.0-BETA1 #31435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.