add file-name info in error message if provided