Skip to main content

Function: getUnknownErrorMessage()

function getUnknownErrorMessage(error: unknown, fallback?: string): string;

Defined in: shared/utils/errorCatalog.ts:462

Derives a user-friendly message from an unknown error value.

Parametersโ€‹

errorโ€‹

unknown

fallback?โ€‹

string = ERROR_CATALOG.system.UNKNOWN_ERROR

Returnsโ€‹

string

Remarksโ€‹

This helper replaces the legacy @shared/utils/errorUtils.getErrorMessage implementation so that fallback strings come from the centralized ERROR_CATALOG.

  • When the supplied value is an Error instance, its own string data message property is returned.
  • All other values yield the provided fallback string.