Handle error reading from result in export_database script