mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Log failed api healthchecks
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from flask import jsonify, request
|
from flask import jsonify, request, current_app
|
||||||
from app import (version, status_api_client)
|
from app import (version, status_api_client)
|
||||||
from app.status import status
|
from app.status import status
|
||||||
from notifications_python_client.errors import HTTPError
|
from notifications_python_client.errors import HTTPError
|
||||||
@@ -12,6 +12,7 @@ def show_status():
|
|||||||
try:
|
try:
|
||||||
api_status = status_api_client.get_status()
|
api_status = status_api_client.get_status()
|
||||||
except HTTPError as e:
|
except HTTPError as e:
|
||||||
|
current_app.logger.exception("API failed to respond")
|
||||||
return jsonify(status="error", message=str(e.message)), 500
|
return jsonify(status="error", message=str(e.message)), 500
|
||||||
return jsonify(
|
return jsonify(
|
||||||
status="ok",
|
status="ok",
|
||||||
|
|||||||
Reference in New Issue
Block a user