From f63cd4774c66b5ccfe5a25f5539eb45687a208ea Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Mon, 29 Jun 2026 14:58:38 +0530 Subject: [PATCH] Added basic exceptions --- app/core/exceptions.py | 11 +++++++++++ app/core/logging.py | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 app/core/exceptions.py create mode 100644 app/core/logging.py diff --git a/app/core/exceptions.py b/app/core/exceptions.py new file mode 100644 index 0000000..f44b4d9 --- /dev/null +++ b/app/core/exceptions.py @@ -0,0 +1,11 @@ +from fastapi import HTTPException, status +class AlemnoException(Exception): + pass +class JobNotFoundException(AlemnoException): + def __init__(self, job_id: str): + self.job_id = job_id + super().__init__(f"Job with ID {job_id} not found") +class InvalidCSVException(AlemnoException): + def __init__(self, detail: str): + self.detail = detail + super().__init__(detail) diff --git a/app/core/logging.py b/app/core/logging.py new file mode 100644 index 0000000..b210329 --- /dev/null +++ b/app/core/logging.py @@ -0,0 +1,11 @@ +import logging +import sys + +# Configure logging format +logging.basicConfig( + level=logging.INFO, + format="%(asctime)s [%(levelname)s] %(name)s: %(message)s", + handlers=[logging.StreamHandler(sys.stdout)], +) + +logger = logging.getLogger("alemno_payments")