mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-20 16:20:18 +00:00
Handle creating Qemu disk images and resizing
This commit is contained in:
@ -34,6 +34,7 @@ from gns3server.controller.controller_error import (
|
||||
ControllerTimeoutError,
|
||||
ControllerForbiddenError,
|
||||
ControllerUnauthorizedError,
|
||||
ComputeConflictError
|
||||
)
|
||||
|
||||
from gns3server.api.routes import controller, index
|
||||
@ -138,6 +139,15 @@ async def controller_bad_request_error_handler(request: Request, exc: Controller
|
||||
)
|
||||
|
||||
|
||||
@app.exception_handler(ComputeConflictError)
|
||||
async def compute_conflict_error_handler(request: Request, exc: ComputeConflictError):
|
||||
log.error(f"Controller received error from compute for request '{exc.url()}': {exc}")
|
||||
return JSONResponse(
|
||||
status_code=409,
|
||||
content={"message": str(exc)},
|
||||
)
|
||||
|
||||
|
||||
# make sure the content key is "message", not "detail" per default
|
||||
@app.exception_handler(HTTPException)
|
||||
async def http_exception_handler(request: Request, exc: HTTPException):
|
||||
|
Reference in New Issue
Block a user