clearwing

changeset 175:c01ce6c825bc 1.2.3-genius

Changed how we fetch query status error message for Blue Query
author Stelios <stv@roe.ac.uk>
date Mon Sep 12 15:58:33 2016 +0300 (2016-09-12)
parents f2b49096e447
children f7f2a9ccb83e
files src/freeform_sql/misc.py
line diff
     1.1 --- a/src/freeform_sql/misc.py	Sat Sep 10 15:54:13 2016 +0300
     1.2 +++ b/src/freeform_sql/misc.py	Mon Sep 12 15:58:33 2016 +0300
     1.3 @@ -428,7 +428,11 @@
     1.4         
     1.5        
     1.6          if query_status=="ERROR" or query_status=="FAILED":
     1.7 -            return {'Code' :-1,  'Content' : 'Query error: A problem occurred while running your query' }
     1.8 +            if (query_json["syntax"]["status"]=="PARSE_ERROR"):
     1.9 +                return {'Code' :-1,  'Content' : 'Query error: ' + query_json["syntax"]["status"] + ' - ' + query_json["syntax"]["friendly"] }
    1.10 +            else: 
    1.11 +                return {'Code' :-1,  'Content' : 'Query error: A problem occurred while running your query' }
    1.12 +
    1.13          elif query_status=="CANCELLED":
    1.14              return {'Code' :1,  'Content' : 'Query error: Query has been canceled' }
    1.15          elif query_status=="EDITING":