error message for (clojure.java.io/reader nil) — consistency for use with io/resource

Description

This seems to be a common idiom:

When a file is available these are the behaviors:

If the file (resource) is unavailable:

This situation would be improved with a better error message from `(clojure.java.io/reader nil)`.

Approach: Extend IOFactory to nil, providing error messages consistent with the default error messages provided for Object.

After:

Patch: clj-1210-2.patch

Environment

None

Activity

Show:
Alexander Redington
February 14, 2014, 9:13 PM

This patch extends IOFactory to nil, providing error messages consistent with the default error messages provided for Object.

Benjamin Peter
February 15, 2014, 7:31 PM

Looks like a good solution to me as a user. Thanks for the effort!

import
July 12, 2014, 8:01 AM

Comment made by: devurandom

I would also be interested in a solution, as I am currently running into this with the ClojureScript compiler.

Alex Miller
October 9, 2015, 3:03 PM

Added -2 patch that makes commit message conform to expectations, no other changes, attribution retained.

Benjamin Peter
October 13, 2015, 9:09 AM

Thanks a lot.

Completed

Assignee

Unassigned

Reporter

import

Approval

Ok

Patch

Code and Test

Fix versions

Affects versions

Priority

Major