lib/remi/data_source/salesforce.rb in remi-0.2.18 vs lib/remi/data_source/salesforce.rb in remi-0.2.19
- old
+ new
@@ -19,9 +19,18 @@
Remi::FieldSymbolizers[:salesforce]
end
def extract
@raw_result = sf_bulk.query(@sfo, @query, 10000)
+
+ check_for_errors(@raw_result)
+ @raw_result
+ end
+
+ def check_for_errors(sf_result)
+ sf_result['batches'].each do |batch|
+ raise "Error with batch #{batch['id']} - #{batch['state']}: #{batch['stateMessage']}" unless batch['state'].first == 'Completed'
+ end
end
def raw_result
@raw_result ||= extract
end