MCPcopy Index your code
hub / github.com/vercel/vercel / errorToString

Function errorToString

packages/error-utils/src/index.ts:58–64  ·  view source on GitHub ↗
(error: unknown, fallback?: string)

Source from the content-addressed store, hash-verified

56 * `try...catch` statement.
57 */
58export const errorToString = (error: unknown, fallback?: string): string => {
59 if (isError(error) || isErrorLike(error)) return error.message;
60
61 if (typeof error === 'string') return error;
62
63 return fallback ?? 'An unknown error has ocurred.';
64};
65
66export const getSystemErrorMessage =
67 nativeGetSystemErrorMessage ?? getSystemErrorMessageFallback;

Callers 15

index.test.tsFile · 0.90
buildFunction · 0.90
mainFunction · 0.90
handleInitDeploymentFunction · 0.90
handleDefaultDeployFunction · 0.90
addAutoProvisionFunction · 0.90
addFunction · 0.90
buyFunction · 0.90
traceFunction · 0.90
logoutFunction · 0.90
logoutFunction · 0.90
inviteFunction · 0.90

Calls 2

isErrorFunction · 0.85
isErrorLikeFunction · 0.85

Tested by

no test coverage detected