Skip to content

Commit

Permalink
Better handle Presto errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
GUI committed Mar 23, 2016
1 parent 6284a9f commit 455eaf0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api-umbrella/web-app/app/models/log_search/kylin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ def execute_presto(sql)
}
while(response.status == 200)
query_result = MultiJson.load(response.body)
if(query_result["stats"] && query_result["stats"]["state"] == "FAILED")
Rails.logger.error(response.body)
raise "Presto Error"
end

if(results["columnMetas"].empty? && query_result["columns"])
results["columnMetas"] = query_result["columns"].map do |column|
{
Expand Down

0 comments on commit 455eaf0

Please sign in to comment.