add filename to errors if possible. Fixes gh-280