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

Function getUserFacingConnectionErrorMessage

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

Source from the content-addressed store, hash-verified

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

Callers 4

getConnectionErrorDetailFunction · 0.90
truncateErrorMessageFunction · 0.90

Calls 1

collectErrorMessagesFunction · 0.85

Tested by

no test coverage detected