Skip to content

Commit

Permalink
catch exception if the metric data is not json format (#1646)
Browse files Browse the repository at this point in the history
  • Loading branch information
liyaqin1 authored Jun 5, 2024
1 parent c4414c5 commit 5a0a92b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deploy-board/deploy_board/webapp/util_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ def _get_latest_metrics(url):
if not data_str:
return 0

data = json.loads(data_str)
try:
data = json.loads(data_str)
except Exception:
log.warning(f"Json decode error for metrics data {data_str}")
return 0
# Return the first datapoint in the datapoints list
if data:
try:
Expand Down

0 comments on commit 5a0a92b

Please sign in to comment.