Handle both path string and filehandle input on exceptions

Cast the file input (which can be a filepath string or a file handle)
to strings so that the nice named exceptions don't break when being
raised
Merge pull request #57 from csojinb/exception_errors

Handle both path string and filehandle input on exceptions