fix(client): use StreamableHTTPError instead of plain Error in send() (#1178)
Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com>
This commit is contained in:
parent
5e97e1a479
commit
6b90e1ada8
2 changed files with 2 additions and 2 deletions
|
|
@ -209,7 +209,7 @@ describe('StreamableHTTPClientTransport', () => {
|
|||
const errorSpy = vi.fn();
|
||||
transport.onerror = errorSpy;
|
||||
|
||||
await expect(transport.send(message)).rejects.toThrow('Error POSTing to endpoint (HTTP 404)');
|
||||
await expect(transport.send(message)).rejects.toThrow('Streamable HTTP error: Error POSTing to endpoint: Session not found');
|
||||
expect(errorSpy).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -534,7 +534,7 @@ export class StreamableHTTPClientTransport implements Transport {
|
|||
}
|
||||
}
|
||||
|
||||
throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`);
|
||||
throw new StreamableHTTPError(response.status, `Error POSTing to endpoint: ${text}`);
|
||||
}
|
||||
|
||||
// Reset auth loop flag on successful response
|
||||
|
|
|
|||
Loading…
Reference in a new issue