提交 0964bc38 编写于 作者: S Steven Li

Added warning message upon REST API failure for crash_gen tool

上级 c4ca6c02
...@@ -561,9 +561,13 @@ class DbConnRest(DbConn): ...@@ -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):
...@@ -2125,7 +2129,7 @@ def main(): ...@@ -2125,7 +2129,7 @@ def main():
parser.add_argument('-t', '--num-threads', action='store', default=5, type=int, parser.add_argument('-t', '--num-threads', action='store', default=5, type=int,
help='Number of threads to run (default: 10)') help='Number of threads to run (default: 10)')
parser.add_argument('-x', '--continue-on-exception', action='store_true', parser.add_argument('-x', '--continue-on-exception', action='store_true',
help='Continue execution after encountering unexpected/disallowed errors/exceptions (default: false)') help='Continue execution after encountering unexpected/disallowed errors/exceptions (default: false)')
global gConfig global gConfig
gConfig = parser.parse_args() gConfig = parser.parse_args()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册