added vegetation

This commit is contained in:
2026-06-23 13:57:33 +03:00
parent 0c9fc22d22
commit c7435955c3
32 changed files with 336 additions and 15 deletions
+10 -1
View File
@@ -5,6 +5,12 @@ from fastapi import HTTPException, status
T = TypeVar("T")
ERROR_CODES = {
"DemNotConfiguredError": "DEM_NOT_CONFIGURED",
"LandcoverNotConfiguredError": "LANDCOVER_NOT_CONFIGURED",
"RasterNotConfiguredError": "RASTER_NOT_CONFIGURED",
}
def as_501(call: Callable[[], T]) -> T:
try:
@@ -12,5 +18,8 @@ def as_501(call: Callable[[], T]) -> T:
except NotImplementedError as exc:
raise HTTPException(
status_code=status.HTTP_501_NOT_IMPLEMENTED,
detail=str(exc),
detail={
"code": ERROR_CODES.get(type(exc).__name__, "NOT_IMPLEMENTED"),
"detail": str(exc),
},
) from exc