mcp: improve http transports error handling and make transport work with any size message (#734)
We have a use case for messages larger than 1MB, hence making this configurable would help. In order to discover the source of our problems we had to spend some time investigating, as errors were silently discarded. So we also included changes to improving surfacing errors . --------- Co-authored-by: Maciej Kisiel <macio92@gmail.com>
This commit is contained in:
parent
8a39cf6ce0
commit
1fb6e204d7
1 changed files with 116 additions and 29 deletions
|
|
@ -1915,6 +1915,14 @@ func (c *streamableClientConn) processStream(ctx context.Context, requestSummary
|
|||
if ctx.Err() != nil {
|
||||
return "", 0, true // don't reconnect: client cancelled
|
||||
}
|
||||
|
||||
// Malformed events are hard errors that indicate corrupted data or protocol
|
||||
// violations. These should fail the connection permanently.
|
||||
if errors.Is(err, errMalformedEvent) {
|
||||
c.fail(fmt.Errorf("%s: %v", requestSummary, err))
|
||||
return "", 0, true
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue