fix: show custom error for modal state (#240)
Calling a tool that resolves modal state, when there's no such modal state visible, currently shows this misleading message: ```md Tool "browser_file_upload" does not handle the modal state. ### Modal state ``` Instead, we should show the error message from the tool implementation.
This commit is contained in:
@@ -30,6 +30,17 @@ test('browser_file_upload', async ({ client }) => {
|
||||
- button "Button" [ref=s1e4]
|
||||
\`\`\``);
|
||||
|
||||
{
|
||||
expect(await client.callTool({
|
||||
name: 'browser_file_upload',
|
||||
arguments: { paths: [] },
|
||||
})).toHaveTextContent(`
|
||||
The tool "browser_file_upload" can only be used when there is related modal state present.
|
||||
### Modal state
|
||||
- There is no modal state present
|
||||
`.trim());
|
||||
}
|
||||
|
||||
expect(await client.callTool({
|
||||
name: 'browser_click',
|
||||
arguments: {
|
||||
|
||||
Reference in New Issue
Block a user