Print file name in error messages if possible.