From 6bea9d2ee551792feb9176c0c5c5d5bbae39e727 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Wed, 27 Aug 2025 07:54:40 -0400 Subject: [PATCH] try catch --- app/api/routes/routes.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/api/routes/routes.py b/app/api/routes/routes.py index 0f08d2b..82d1e40 100644 --- a/app/api/routes/routes.py +++ b/app/api/routes/routes.py @@ -244,10 +244,22 @@ def stripe_payments_webhook_post(): @api.route("/stripe/payments", methods=["GET"]) def stripe_payments_webhook_get(): - data = request.args() - logger.info(f"Route Stripe Webhook GET ==>>>> {data}") - # response = MyProductsService.process_provision_actions(data) - return [] + try: + data = request.args() + logger.info(f"Route Stripe Webhook GET ==>>>> {data}") + # response = MyProductsService.process_provision_actions(data) + return [] + except Exception as e: + # A general exception handler for any other type of exception + logger.error(f"An unexpected error occurred: {e}") + else: + # Code to execute if no exception occurs in the try block + logger.info("Operation successful!") + finally: + # Code that will always execute, regardless of whether an exception occurred or not + logger.info("This block always runs.") + + # /panel/account/calendar @api.route("/panel/account/calendar", methods=["POST"])