diff --git a/src/aare/daq/server_exception_handler.py b/src/aare/daq/server_exception_handler.py index e02555fc..3728eb4a 100644 --- a/src/aare/daq/server_exception_handler.py +++ b/src/aare/daq/server_exception_handler.py @@ -63,8 +63,8 @@ def register_exception_handlers(app) -> None: @app.exception_handler(MountingFailed) async def mounting_failed_handler(request: Request, exc: MountingFailed) -> JSONResponse: return JSONResponse( - status_code=api_status.HTTP_404_NOT_FOUND, - content=_error_payload(code="MOUNTING_FAILED", message=str(exc)), + status_code=api_status.HTTP_409_CONFLICT, + content=_error_payload(code="MOUNTING_FAILED", message=str(exc) or "Failed to mount sample"), ) @app.exception_handler(UnmountingFailed)