MCPcopy Create free account
hub / github.com/codehamr/codehamr / applyError

Method applyError

internal/tui/model.go:833–843  ·  view source on GitHub ↗

applyError unwinds the turn on a stream error: preserve content streamed before the error (so the user keeps failure context), emit the one-line hint, drop the pending queue, reset turn state.

(e llm.Event)

Source from the content-addressed store, hash-verified

831 m.phase = phaseStreaming
832 }
833 m.streamingEstimate += len(e.Content) / 4
834 case llm.EventToolCall:
835 m.applyToolCall(e)
836 case llm.EventDone:
837 m.applyDone(e)
838 case llm.EventError:
839 return m, m.applyError(e)
840 }
841 return m, readEvent(m.stream)
842}
843
844// applyContent writes one streamed text chunk to the live buffer and promotes
845// phase from thinking to streaming on the first chunk so the status bar shows
846// tokens flowing. View() renders the buffer live above the prompt; once the

Callers 1

handleStreamMethod · 0.95

Calls 4

abortTurnMethod · 0.95
errorMessageMethod · 0.95
dbgWritefFunction · 0.85
isUnreachableFunction · 0.85

Tested by

no test coverage detected