Skip to content

Commit f6cd034

Browse files
CodeQL warning
1 parent dbec8ad commit f6cd034

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

dbclient/dbclient.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,17 +268,15 @@ def http_req(self, http_type, endpoint, json_params, version='2.0', print_json=F
268268
message = "Error: {0} request failed with code {1}\n{2}".format(
269269
http_type, http_status_code, raw_results.text
270270
)
271-
error_json = {
272-
'http_status_code': raw_results.status_code,
273-
'error': raw_results.text,
274-
'url': full_endpoint,
275-
'json': json_params,
276-
}
277271
if self.is_skip_failed():
278272
logging.error(message)
279-
return error_json
273+
return {
274+
'http_status_code': raw_results.status_code,
275+
'error': raw_results.text,
276+
'url': full_endpoint,
277+
'json': json_params,
278+
}
280279
else:
281-
logging.error(error_json)
282280
raise Exception(message)
283281
results = raw_results.json()
284282
if logging_utils.check_error(results):

0 commit comments

Comments
 (0)