Added basic exceptions

This commit is contained in:
2026-06-29 14:58:38 +05:30
parent a2a25d7bfb
commit f63cd4774c
2 changed files with 22 additions and 0 deletions

11
app/core/exceptions.py Normal file
View File

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

11
app/core/logging.py Normal file
View File

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