We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae2b9a2 commit bf43221Copy full SHA for bf43221
backend/apps/db/es_engine.py
@@ -5,6 +5,7 @@
5
6
import requests
7
from elasticsearch import Elasticsearch
8
+from fastapi import HTTPException
9
10
from apps.datasource.models.datasource import DatasourceConf
11
@@ -61,7 +62,8 @@ def get_es_fields(conf: DatasourceConf, table_name: str):
61
62
63
def get_es_data(conf: DatasourceConf, sql: str, table_name: str):
64
r = requests.post(f"{conf.host}/_sql/translate", json={"query": sql})
- # print(json.dumps(r.json()))
65
+ if r.json().get('error'):
66
+ raise HTTPException(status_code=500, detail=f': {json.dumps(r.json())}')
67
68
es_client = get_es_connect(conf)
69
response = es_client.search(
0 commit comments