Export GetError and SetError methods (#753)

Exported GetError and SetError. 

Fixes #64

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Jonathan Amsterdam 2026-01-15 11:46:13 -05:00 • committed by GitHub
commit 13488f7da1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2124,7 +2124,7 @@ func TestToolErrorMiddleware(t *testing.T) {
res, err := h(ctx, method, req)
if err == nil {
if ctr, ok := res.(*CallToolResult); ok {
middleErr = ctr.getError()
middleErr = ctr.GetError()
}
}
return res, err
@ -2161,7 +2161,7 @@ func TestToolErrorMiddleware(t *testing.T) {
t.Fatal("want error, got none")
}
// Clients can't see the error, because it isn't marshaled.
if err := res.getError(); err != nil {
if err := res.GetError(); err != nil {
t.Fatalf("got %v, want nil", err)
}
if middleErr != errTestFailure {