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

We no longer catch an error just to throw it again. #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BenMaer-Parkwood
Copy link

The line let url = try createURL(for: path, in: directory) was in a try catch block, such that if an error was thrown inside createURL(...), it would be caught in the catch block, only to be thrown again.

The same issue was the case for the error thrown if FileManager.default.fileExists(atPath: url.path) returned true. It would throw the error, then catch it, then throw it again.

Seeing how there was no extra logic that was performed by the catch block, there was no reason to have that catch block.

This update makes changes so that the redundant catch and throw is avoided.

@BenMaer-Parkwood BenMaer-Parkwood marked this pull request as ready for review April 22, 2019 14:42
craigrouse added a commit to craigrouse/Disk that referenced this pull request May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant