Add errors handler when processing file