Remove prefix on over-the-wire ProtocolErrors (#1727)
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
This commit is contained in:
parent
72fe68b266
commit
a7c7896a56
3 changed files with 7 additions and 7 deletions
|
|
@ -2340,7 +2340,7 @@ export class ProtocolError extends Error {
|
|||
message: string,
|
||||
public readonly data?: unknown
|
||||
) {
|
||||
super(`MCP error ${code}: ${message}`);
|
||||
super(message);
|
||||
this.name = 'ProtocolError';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -809,7 +809,7 @@ test('should wrap unexpected validator errors during elicitInput', async () => {
|
|||
required: []
|
||||
}
|
||||
})
|
||||
).rejects.toThrow('MCP error -32603: Error validating elicitation response: boom - validator exploded');
|
||||
).rejects.toThrow('Error validating elicitation response: boom - validator exploded');
|
||||
});
|
||||
|
||||
test('should forward notification options when using elicitation completion notifier', async () => {
|
||||
|
|
|
|||
|
|
@ -841,7 +841,7 @@ function testElicitationFlow(validatorProvider: typeof ajvProvider | typeof cfWo
|
|||
required: ['color']
|
||||
}
|
||||
})
|
||||
).rejects.toThrow(/^MCP error -32602: Elicitation response content does not match requested schema/);
|
||||
).rejects.toThrow(/^Elicitation response content does not match requested schema/);
|
||||
});
|
||||
|
||||
test(`${validatorName}: should reject invalid selection in single-select titled enum`, async () => {
|
||||
|
|
@ -875,7 +875,7 @@ function testElicitationFlow(validatorProvider: typeof ajvProvider | typeof cfWo
|
|||
required: ['color']
|
||||
}
|
||||
})
|
||||
).rejects.toThrow(/^MCP error -32602: Elicitation response content does not match requested schema/);
|
||||
).rejects.toThrow(/^Elicitation response content does not match requested schema/);
|
||||
});
|
||||
|
||||
test(`${validatorName}: should reject invalid selection in single-select titled legacy enum`, async () => {
|
||||
|
|
@ -906,7 +906,7 @@ function testElicitationFlow(validatorProvider: typeof ajvProvider | typeof cfWo
|
|||
required: ['color']
|
||||
}
|
||||
})
|
||||
).rejects.toThrow(/^MCP error -32602: Elicitation response content does not match requested schema/);
|
||||
).rejects.toThrow(/^Elicitation response content does not match requested schema/);
|
||||
});
|
||||
|
||||
// Enums - Invalid - Multi Select - Untitled / Titled
|
||||
|
|
@ -943,7 +943,7 @@ function testElicitationFlow(validatorProvider: typeof ajvProvider | typeof cfWo
|
|||
required: ['color']
|
||||
}
|
||||
})
|
||||
).rejects.toThrow(/^MCP error -32602: Elicitation response content does not match requested schema/);
|
||||
).rejects.toThrow(/^Elicitation response content does not match requested schema/);
|
||||
});
|
||||
|
||||
test(`${validatorName}: should reject invalid selection in multi-select titled enum`, async () => {
|
||||
|
|
@ -981,6 +981,6 @@ function testElicitationFlow(validatorProvider: typeof ajvProvider | typeof cfWo
|
|||
required: ['colors']
|
||||
}
|
||||
})
|
||||
).rejects.toThrow(/^MCP error -32602: Elicitation response content does not match requested schema/);
|
||||
).rejects.toThrow(/^Elicitation response content does not match requested schema/);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue