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")