Skip to content

Flutter structured errors aren't formatted well when using SDK DAPs #4571

Description

@waleedf112

The console doesn't show the exceptions correctly, links are in red, not clickable,

Dart-Code-Log-2023-05-05 19-17-57.txt


with legacy DAPs:
start of the exception:
image
middle:
image
end:
image


currently: all of the console log looks like this with nothing clickable and not clear stacktrace.
image

Activity

  1. changed the title [-]exceptions aren't formatted correctly[/-] [+]Flutter structured errors aren't formatted well when using SDK DAPs[/+] on Jun 5, 2023
  2. DanTup commented on Jun 5, 2023

    @DanTup
    Member

    @jacob314 it turns out that we never implemented handling of structured errors in the new DAPs, we only forwarded the rendered text to the debug console as error text.

    We discussed this previously and wanted to use the Flutter classes like DiagnosticsNode to deserialise the error, but they live in package:flutter and are not accessible to DAP (flutter_tools). I had tried moving them, but the full set of types they reference is quite large and would've meant moving a lot of code.

  3. added this to the On Deck milestone on Jun 5, 2023
  4. added
    in flutterRelates to running Flutter apps
    in debuggingRelates to the debug adapter or process of running debug sessions
    on Jun 5, 2023
  5. modified the milestones: On Deck, v3.68.0 on Jun 5, 2023
  6. DanTup commented on Jun 21, 2023

    @DanTup
    Member

    Here's a small repro with the Flutter.Error event JSON and how each adapter looks:

    Legacy:

    error_legacy_dap

    SDK:

    error_sdk_dap

  7. modified the milestones: v3.68.0, v3.70.0 on Jun 28, 2023
  8. modified the milestones: v3.70.0, v3.72.0 on Jul 27, 2023
  9. DanTup commented on Jul 31, 2023

    @DanTup
    Member

    Improvements to this have landed in the latest Flutter master and will, ship in a future SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsin flutterRelates to running Flutter appsis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions