wangzhibo
2026-05-09 53418655c061ac26f66058253f39200aced1ab1d
1
2
3
4
5
6
7
{
  "version": 3,
  "sources": ["../../src/restError.ts"],
  "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RestError } from \"@azure/core-rest-pipeline\";\nimport type { PathUncheckedResponse } from \"./common.js\";\n\nimport {\n  createRestError as tspCreateRestError,\n  type PathUncheckedResponse as TspPathUncheckedResponse,\n} from \"@typespec/ts-http-runtime\";\n\n/**\n * Creates a rest error from a PathUnchecked response\n */\nexport function createRestError(response: PathUncheckedResponse): RestError;\n/**\n * Creates a rest error from an error message and a PathUnchecked response\n */\nexport function createRestError(message: string, response: PathUncheckedResponse): RestError;\nexport function createRestError(\n  messageOrResponse: string | PathUncheckedResponse,\n  response?: PathUncheckedResponse,\n): RestError {\n  if (typeof messageOrResponse === \"string\") {\n    return tspCreateRestError(messageOrResponse, response! as TspPathUncheckedResponse);\n  } else {\n    return tspCreateRestError(messageOrResponse as TspPathUncheckedResponse);\n  }\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,6BAGO;AAUA,SAAS,gBACd,mBACA,UACW;AACX,MAAI,OAAO,sBAAsB,UAAU;AACzC,eAAO,uBAAAA,iBAAmB,mBAAmB,QAAqC;AAAA,EACpF,OAAO;AACL,eAAO,uBAAAA,iBAAmB,iBAA6C;AAAA,EACzE;AACF;",
  "names": ["tspCreateRestError"]
}