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

Workaround for exception-throwing canonicalizePath in old directory #104

Merged
merged 1 commit into from Jan 25, 2017

Conversation

@liskin
Copy link
Contributor

commented Jan 24, 2017

See: haskell/directory#44 (comment)

This makes the exception for nonexistent yaml files the same regardless of
which version of the directory package is used.

@@ -37,6 +44,14 @@ eventsFromFile = go []

irrelevantEvents = [EventStreamStart, EventDocumentStart, EventDocumentEnd, EventStreamEnd]

#if !MIN_VERSION_directory(1, 2, 3)
catchNotFound = handleJust

This comment has been minimized.

Copy link
@sol

sol Jan 25, 2017

Collaborator

Bikeshedding: I would call this handleNotFound

This comment has been minimized.

Copy link
@snoyberg

snoyberg Jan 25, 2017

Owner

👍 that would be slightly nicer.

@sol

This comment has been minimized.

Copy link
Collaborator

commented Jan 25, 2017

LGTM

@@ -37,6 +44,14 @@ eventsFromFile = go []

irrelevantEvents = [EventStreamStart, EventDocumentStart, EventDocumentEnd, EventStreamEnd]

#if !MIN_VERSION_directory(1, 2, 3)
catchNotFound = handleJust

This comment has been minimized.

Copy link
@snoyberg

snoyberg Jan 25, 2017

Owner

👍 that would be slightly nicer.

@@ -1,6 +1,13 @@
{-# LANGUAGE CPP #-}

This comment has been minimized.

Copy link
@snoyberg

snoyberg Jan 25, 2017

Owner

Can you give this a patch version bump and include a note in the ChangeLog?

This comment has been minimized.

Copy link
@liskin

liskin Jan 25, 2017

Author Contributor

Sure, I think I addressed everything.

@@ -37,6 +44,14 @@ eventsFromFile = go []

irrelevantEvents = [EventStreamStart, EventDocumentStart, EventDocumentEnd, EventStreamEnd]

#if !MIN_VERSION_directory(1, 2, 3)
catchNotFound = handleJust
(\e -> guard (isDoesNotExistError e) >> guard (ioeGetLocation e == "canonicalizePath") >> ioeGetFileName e)

This comment has been minimized.

Copy link
@snoyberg

snoyberg Jan 25, 2017

Owner

Not at all important, but IMO do notation would be slightly more legible here.

Workaround for exception-throwing canonicalizePath in old directory
See: haskell/directory#44 (comment)

This makes the exception for nonexistent yaml files the same regardless
of which version of the directory package is used.

@snoyberg snoyberg merged commit 02b2d5d into snoyberg:master Jan 25, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@snoyberg

This comment has been minimized.

Copy link
Owner

commented Jan 25, 2017

Thanks!

@liskin liskin deleted the liskin:directory-canonicalizePath-exception branch Mar 4, 2017

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