MCPcopy Create free account
hub / github.com/microsoft/data-formulator / getErrorMessage

Function getErrorMessage

src/app/errorCodes.ts:64–71  ·  view source on GitHub ↗
(apiError: ApiError)

Source from the content-addressed store, hash-verified

62 * Tries the i18n translation first; falls back to the backend message.
63 */
64export function getErrorMessage(apiError: ApiError): string {
65 const i18nKey = ERROR_CODE_I18N_MAP[apiError.code];
66 if (i18nKey) {
67 const translated = i18n.t(i18nKey);
68 if (translated !== i18nKey) return translated;
69 }
70 return apiError.message;
71}

Callers 6

SimpleChartRecBoxFunction · 0.90
extractConnectErrorFunction · 0.90
extractErrorMessageFunction · 0.90
handleApiErrorFunction · 0.90
streamIdeasFunction · 0.90
errorCodes.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected