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

Function extractErrorMessage

src/app/errorHandler.ts:43–54  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

41 * literals in thunk .catch callbacks) instead of dispatching via handleApiError.
42 */
43export function extractErrorMessage(error: unknown): string {
44 if (error instanceof ApiRequestError) {
45 return getErrorMessage(error.apiError);
46 }
47 if (error instanceof Error) {
48 return error.message;
49 }
50 if (isSerializedError(error)) {
51 return error.message;
52 }
53 return String(error);
54}
55
56export interface HandleApiErrorOptions {
57 /** When true, do not dispatch to MessageSnackbar. */

Callers 3

DataSourceSidebarPanelFunction · 0.90
DataThreadFunction · 0.90

Calls 2

getErrorMessageFunction · 0.90
isSerializedErrorFunction · 0.85

Tested by

no test coverage detected