Improved exception messages thrown when inspecting filepaths.