Handle error and success messages for export