MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / getUserFacingConnectionErrorMessage

Function getUserFacingConnectionErrorMessage

src/utils/user-facing-error.ts:77–88  ·  view source on GitHub ↗
(
  error: unknown,
)

Source from the content-addressed store, hash-verified

75}
76
77export function getUserFacingConnectionErrorMessage(
78 error: unknown,
79): string | null {
80 const messages = collectErrorMessages(error);
81 if (messages.some(isCorsOrNetworkErrorMessage)) {
82 return CORS_OR_NETWORK_ERROR_MESSAGE;
83 }
84 if (messages.some(isBackendRequestTimeoutMessage)) {
85 return BACKEND_REQUEST_TIMEOUT_MESSAGE;
86 }
87 return messages[0] ?? null;
88}

Callers 5

getConnectionErrorDetailFunction · 0.90
truncateErrorMessageFunction · 0.90

Calls 1

collectErrorMessagesFunction · 0.85

Tested by

no test coverage detected