Skip to content

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

Closed

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.

Activity

  1. self-assigned this
    on Oct 20, 2025
  2. added
    vm-serviceThe VM Service Protocol, both the specification and its implementation
    on Oct 20, 2025
  3. added
    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
    on Oct 20, 2025
  4. added
    P2A bug or feature request we're likely to work on
    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
    triagedIssue has been triaged by sub team
    on Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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