mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-18 00:54:27 +03:00
maintain exception for non validation errors
This commit is contained in:
parent
2dbc1e5d17
commit
69e4992151
@ -16,6 +16,7 @@ from fastapi import APIRouter, Body, Path, Request, Response
|
|||||||
from fastapi.encoders import jsonable_encoder
|
from fastapi.encoders import jsonable_encoder
|
||||||
from fastapi.params import Depends
|
from fastapi.params import Depends
|
||||||
from fastapi.responses import JSONResponse, PlainTextResponse
|
from fastapi.responses import JSONResponse, PlainTextResponse
|
||||||
|
from markupsafe import escape
|
||||||
from peewee import operator
|
from peewee import operator
|
||||||
from pydantic import ValidationError
|
from pydantic import ValidationError
|
||||||
|
|
||||||
@ -247,6 +248,17 @@ def config_save(save_option: str, body: Any = Body(media_type="text/plain")):
|
|||||||
status_code=400,
|
status_code=400,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
except Exception:
|
||||||
|
return JSONResponse(
|
||||||
|
content=(
|
||||||
|
{
|
||||||
|
"success": False,
|
||||||
|
"message": f"\nYour configuration is invalid.\nSee the official documentation at docs.frigate.video.\n\n{escape(str(traceback.format_exc()))}",
|
||||||
|
}
|
||||||
|
),
|
||||||
|
status_code=400,
|
||||||
|
)
|
||||||
|
|
||||||
# Save the config to file
|
# Save the config to file
|
||||||
try:
|
try:
|
||||||
config_file = find_config_file()
|
config_file = find_config_file()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user