code: def get_server_client_error_details(
      error: ServerClientError,
  ) -> List[Dict]:
      if len(error.fields) == 0:
          return [error_detail(msg=error.msg, code=error.code)]
      details = []
      for field_path in error.fields:
          details.append(
              error_detail(
                  msg=error.msg, code=error.code, fields=field_path
              )
          )
      return details
  
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 6 for calling a global function with example usage: get_server_client_error_details(error) and returns: details, list