Pārlūkot izejas kodu

Handle drill errors correctly

Andrew Kane 7 gadi atpakaļ
vecāks
revīzija
810efce24e
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6 2
      lib/blazer/adapters/drill_adapter.rb

+ 6 - 2
lib/blazer/adapters/drill_adapter.rb

@@ -17,8 +17,12 @@ module Blazer
 
         begin
           response = JSON.parse(http.post(uri.request_uri, data.to_json, header).body)
-          columns = response["columns"]
-          rows = response["rows"].map { |r| r.values }
+          if response["errorMessage"]
+            error = response["errorMessage"]
+          else
+            columns = response["columns"]
+            rows = response["rows"].map { |r| r.values }
+          end
         rescue => e
           error = e.message
         end