Skip to content

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.

1 participant