MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / fail

Method fail

mcp/streamable.go:1739–1746  ·  view source on GitHub ↗

fail handles an asynchronous error while reading. If err is non-nil, it is terminal, and subsequent (or pending) Reads will fail. If err wraps ErrSessionMissing, the failure indicates that the session is no longer present on the server, and no final DELETE will be performed when closing the connec

(err error)

Source from the content-addressed store, hash-verified

1737// longer present on the server, and no final DELETE will be performed when
1738// closing the connection.
1739func (c *streamableClientConn) fail(err error) {
1740 if err != nil {
1741 c.failOnce.Do(func() {
1742 c._failure = err
1743 close(c.failed)
1744 })
1745 }
1746}
1747
1748func (c *streamableClientConn) failure() error {
1749 select {

Callers 5

connectStandaloneSSEMethod · 0.95
WriteMethod · 0.95
handleJSONMethod · 0.95
handleSSEMethod · 0.95
processStreamMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected