-
Notifications
You must be signed in to change notification settings - Fork 3
400 errors should show the actual error in the queryΒ #67
Copy link
Copy link
Open
Description
Replication:
Fetch a missing metric using query API
Current behavior
The error raised does not indicate what is wrong with the query
Traceback (most recent call last):
File "/home/ubuntu/Code/apptuit/tenants/bigbasket/es-glacier-snaphots/toktest.py", line 14, in <module>
retry_count=3 # this will retry in case of 500 response or connection errors occur.
File "/usr/local/lib/python2.7/dist-packages/apptuit/apptuit_client.py", line 362, in query
"query service due to exception: %s" % str(http_error))
apptuit.apptuit_client.ApptuitException: Failed to get response from Apptuitquery service due to exception: 400 Client Error: for url: https://api.apptuit.ai/api/query?start=1584607074&q=fetch%28%27missing_metric%27%29
Expectation
The API response has the error message that says the metric is missing. This message should be passed on to the API caller
{
"status":"error",
"message":"Query failed due to errors",
"data":{
"errors":[
{
"errorType":"ERROR_FETCHING_FROM_DATASOURCE",
"queryLineNo":1,
"queryColumnOffset":-1,
"message":"Requested metrics(missing_metric) not found"
}
]
},
"query_stats":{
},
"timing_diagnostics":[
],
"query":{
"querytext":"fetch('missing_metric')",
"startTime":1584607112,
"startTimeHumanReadableSYS":"March 19, 2020 8:38:32 AM UTC",
"startTimeHumanReadableIST":"March 19, 2020 2:08:32 PM IST",
"endTime":1584610762,
"endTimeHumanReadableSYS":"March 19, 2020 9:39:22 AM UTC",
"endTimeHumanReadableIST":"March 19, 2020 3:09:22 PM IST"
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels