## 27) Error response body shape is inconsistent
This commit is contained in:
@@ -17,7 +17,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
|
||||
from fastapi import APIRouter, HTTPException, Query, Request
|
||||
from fastapi import APIRouter, Query, Request
|
||||
|
||||
from app.dependencies import (
|
||||
AuthDep,
|
||||
@@ -26,6 +26,7 @@ from app.dependencies import (
|
||||
HistoryServiceContextDep,
|
||||
HttpSessionDep,
|
||||
)
|
||||
from app.exceptions import HistoryNotFoundError
|
||||
from app.models.ban import BanOrigin, TimeRange
|
||||
from app.models.history import HistoryListResponse, IpDetailResponse
|
||||
from app.services import history_service
|
||||
@@ -188,6 +189,6 @@ async def get_ip_history(
|
||||
)
|
||||
|
||||
if detail is None:
|
||||
raise HTTPException(status_code=404, detail=f"No history found for IP {ip!r}.")
|
||||
raise HistoryNotFoundError(ip)
|
||||
|
||||
return detail
|
||||
|
||||
Reference in New Issue
Block a user