print AFC error code in case afc_file_write fails