Skip to content

Commit

Permalink
Handle drill errors correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 8, 2017
1 parent e5cfa0f commit 810efce
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/blazer/adapters/drill_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ def run_statement(statement, comment)

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
Expand Down

0 comments on commit 810efce

Please sign in to comment.