mirror of
https://github.com/sortedcord/alemno-payments.git
synced 2026-07-22 04:02:49 +05:30
Added basic exceptions
This commit is contained in:
11
app/core/exceptions.py
Normal file
11
app/core/exceptions.py
Normal 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
11
app/core/logging.py
Normal 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")
|
||||
Reference in New Issue
Block a user