Skip to content

Commit

Permalink
added more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
sametd committed Mar 12, 2024
1 parent 631ba76 commit 23c4e62
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions aviso-server/rest/aviso_rest/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,21 @@ async def api_notify(request: Request):
:param request: The incoming HTTP request with the notification.
:return: A JSON response indicating the result of the notification processing.
"""
logger.debug("New notification received")
body = await request.json()
if body is None:
raise HTTPException(status_code=400, detail="Invalid notification, Body cannot be empty")

logger.debug(body)
try:
notification = await frontend._parse_cloud_event(request)
logger.info(f"New event received: {notification}")
if frontend._skip_request(notification, frontend.config.skips):
logger.info("Notification skipped")
return {"message": "Notification skipped"}
# Implement the notification logic here.
except InvalidInputError as e:
raise HTTPException(status_code=400, detail=str(e))

logger.info("Notification successfully submitted")
return {"message": "Notification successfully submitted"}


Expand Down

0 comments on commit 23c4e62

Please sign in to comment.