Skip to content

Flutter driver should provide better error handling for malformed RPCs #172127

@jakemac53

Description

@jakemac53

Use case

Today if you call a flutter driver extension, they assume the RPCs are well formed. Presumably, this is safe today because the expectation is all these calls are coming from actual flutter driver API calls.

I am trying to integrate the Dart MCP server with flutter driver (see dart-lang/ai#222), and inevitably the LLMs will create bad RPC calls into flutter driver.

It would be very helpful if the error messages were better so the LLM could figure out its mistake. Mostly commonly what I see today is just raw null assertion errors or "too many elements" errors.

Proposal

All flutter_driver RPC handlers should have explicit error handling instead of using ! and .single, so that it can provide nice errors about which arguments were malformed, missing, etc.

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projecta: error messageError messages from the Flutter frameworkc: proposalA detailed proposal for a change to Flutterr: fixedIssue is closed as already fixed in a newer versiont: flutter driver"flutter driver", flutter_drive, or a driver testteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions