Skip to content

Commit

Permalink
Suppresses timeout runtime errors for status checks (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Crossedfall committed Aug 24, 2023
1 parent 2960db9 commit 64ccc69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bapi/resources/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def get(self):

return jsonify(d)

except TimeoutError:
return jsonify({"error": "timed out"})
except Exception as E:
abort(500, {"error": str(E)})

Expand All @@ -36,6 +38,8 @@ def get(self, id):

try:
return jsonify(util.fetch_server_status(id))
except TimeoutError:
return jsonify({"error": "timed out"})
except Exception as E:
abort(500, {"error": str(E)})

Expand Down

0 comments on commit 64ccc69

Please sign in to comment.