template for service rather than hub

Previous template structure had direct handling of auth. This structure is designed to get auth from the hub instead.
This commit is contained in:
Chris Milne 2026-06-05 16:39:14 +01:00
parent ed4a3fe0b8
commit ea9803536a
27 changed files with 223 additions and 117 deletions

View file

@ -1,3 +1,28 @@
"""
Global exceptions
"""
Exports:
- UnprocessableContentException
- ConflictException
"""
from typing import Optional
from fastapi import HTTPException, status
class UnprocessableContentException(HTTPException):
def __init__(self, message: Optional[str] = None) -> None:
detail = "Unprocessable content" if not message else message
super().__init__(
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
detail=detail,
)
class ConflictException(HTTPException):
def __init__(self, message: Optional[str] = None) -> None:
detail = "Conflict" if not message else message
super().__init__(
status_code=status.HTTP_409_CONFLICT,
detail=detail,
)