(apiError: ApiError)
| 62 | * Tries the i18n translation first; falls back to the backend message. |
| 63 | */ |
| 64 | export 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 | } |
no outgoing calls
no test coverage detected