code: def gateway_error(data: dict) -> GatewayError:
      detail = data["detail"]
      return GatewayError(msg=f"{detail['error']}: {detail['message']}")
  
file_path: dstack/src/dstack/_internal/server/services/gateways/client.py
imports: import requests
  from dstack._internal.core.errors import GatewayError
  from dstack._internal.core.models.runs import Job, JobProvisioningData
label_desc: Use image node_id 1 for calling a global function with example usage: gateway_error(data) and returns: GatewayError