code: def error_detail(
      msg: str, code: Optional[str] = None, **kwargs
  ) -> Dict:
      return {"msg": msg, "code": code, **kwargs}
  
file_path: dstack/src/dstack/_internal/server/utils/routers.py
imports: from typing import Dict, List, Optional
  from fastapi import HTTPException, Request, Response, status
  from fastapi.responses import JSONResponse
  from packaging import version
  from dstack._internal.core.errors import ServerClientError
  from dstack._internal.server import settings
label_desc: Use image node_id 1 for calling a global function with example usage: error_detail(msg, code) and returns: dict