parent
d0c8c6c297
commit
75f5bc79da
4 changed files with 59 additions and 20 deletions
|
|
@ -4,4 +4,16 @@ Module specific exceptions for <this module>
|
|||
Exceptions:
|
||||
- List: Description
|
||||
- Exceptions: Description
|
||||
"""
|
||||
"""
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
|
||||
class ServiceNotFoundException(HTTPException):
|
||||
def __init__(self, service_id: Optional[int] = None) -> None:
|
||||
detail = "Service not found" if service_id is None else f"Service with ID '{service_id}' was not found."
|
||||
super().__init__(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail=detail,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue