diff --git a/tap_salesforce/salesforce/bulk.py b/tap_salesforce/salesforce/bulk.py index 02c48ba9..9a9fae90 100644 --- a/tap_salesforce/salesforce/bulk.py +++ b/tap_salesforce/salesforce/bulk.py @@ -107,8 +107,8 @@ def _bulk_query(self, catalog_entry, state): LOGGER.info("Finished syncing batch %s. Removing batch from state.", completed_batch_id) LOGGER.info("Batches to go: %d", len(state['bookmarks'][catalog_entry['tap_stream_id']]["BatchIDs"])) singer.write_state(state) - - raise TapSalesforceException(batch_status['stateMessage']) + else: + raise TapSalesforceException(batch_status['stateMessage']) else: for result in self.get_batch_results(job_id, batch_id, catalog_entry): yield result