Screener's Note: (this note is about previously screened patch better-error-messages-for-require.diff that was not approved) This works as advertised, but I have reservations about the approach. We could accept the patch as-is, or a much simpler patch that handles the only important (IMO) case: a-b-c to a_b_c – without generating and testing for unlikely errors like a-b_c. Please advise.
Problem: Clojure requires the files that back a namespace that has dashes in it to have the dashes replaced with underscores on the filesystem (ie a.b_c.clj for namespace a.b-c). If you require a file that has been mistakenly saved as b-c.clj instead, you will get an error message:
- When loading the resource-root of lib throws a FileNotFoundException, the name of the lib is analyzed.
- If it contains no dash character, throw the original exception (same as current behavior).
- If it contains a dash character, throw an exception with the same message as the original, except an additional hint is appended to it that perhaps the file should have dash characters replaced with underscores