emit error on read file error instead of through error