Added warning message upon REST API failure for crash_gen tool
This commit is contained in:
parent
c4ca6c022f
commit
0964bc38de
|
@ -561,9 +561,13 @@ class DbConnRest(DbConn):
|
||||||
self.isOpen = False
|
self.isOpen = False
|
||||||
|
|
||||||
def _doSql(self, sql):
|
def _doSql(self, sql):
|
||||||
r = requests.post(self._url,
|
try:
|
||||||
data = sql,
|
r = requests.post(self._url,
|
||||||
auth = HTTPBasicAuth('root', 'taosdata'))
|
data = sql,
|
||||||
|
auth = HTTPBasicAuth('root', 'taosdata'))
|
||||||
|
except:
|
||||||
|
print("REST API Failure (TODO: more info here)")
|
||||||
|
raise
|
||||||
rj = r.json()
|
rj = r.json()
|
||||||
# Sanity check for the "Json Result"
|
# Sanity check for the "Json Result"
|
||||||
if (not 'status' in rj):
|
if (not 'status' in rj):
|
||||||
|
|
Loading…
Reference in New Issue