MCPcopy Create free account
hub / github.com/chieapp/chie / #onMessageError

Method #onMessageError

src/view/chat-view.ts:411–429  ·  view source on GitHub ↗
(error: Error | APIError)

Source from the content-addressed store, hash-verified

409
410 // There is error thrown when sending message.
411 #onMessageError(error: Error | APIError) {
412 if (error.name == 'AbortError')
413 this.messagesView.abortPending();
414 else if (error.name == 'APIError' || error.name == 'NetworkError')
415 this.messagesView.appendError(error.message);
416 else
417 this.messagesView.appendError(error.stack);
418 // Append refresh button.
419 if (error.name == 'APIError') {
420 const code = (error as APIError).code;
421 if (code == 'refresh')
422 this.messagesView.setReplyActions(['refresh']);
423 else if (code == 'relogin')
424 this.messagesView.setReplyActions(['relogin']);
425 else if (code == 'invalid-session')
426 this.messagesView.setReplyActions(['clear']);
427 }
428 this.#resetUIState();
429 }
430
431 // A full message has been received.
432 #onMessageEnd(message, response) {

Callers 1

loadServiceMethod · 0.95

Calls 4

#resetUIStateMethod · 0.95
abortPendingMethod · 0.80
appendErrorMethod · 0.80
setReplyActionsMethod · 0.80

Tested by

no test coverage detected