Skip to content

RPCError is incorrectly re-encoded as kServerError in vmService #61757

@jyameo

Description

@jyameo

The _routeRequest method in vm_service.dart has a bug where it catches and re-encodes RPCError exceptions as kServerError, losing the original error code and information.

This causes issues when code specifically throws an RPCError with a particular error code (e.g., kIsolateCannotReload), as that error code is lost and replaced with kServerError.

Expected Behavior
When an RPCError is thrown, it should be preserved as-is without re-encoding. Only non-RPCError exceptions should be wrapped as kServerError.

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.triagedIssue has been triaged by sub teamtype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)vm-serviceThe VM Service Protocol, both the specification and its implementation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions