dart-lang / dart-lang/webdev

Throw a more descriptive error if the metadata can't be found

Open
#1,203 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
224
Forks
94
Avg merge
7h 14m
Merged PRs (30d)
2

Description

If we can't read the DDC metadata file we get an odd state error:

```
Thread 0 main threadStateError: Bad state: No element
at List.last(growable_array.dart:255)
at AppInspector._initialize(inspector.dart:90)
at (async)
at AppInspector.initialize(inspector.dart:155)
at (async)
at ChromeProxyService.createIsolate(chrome_proxy_service.dart:180)
at (async)
```

This is because we get an empty list of libraries. We should implement better logging here and throw a better more descriptive state error.

Contributor guide

Open the contributing guide

Research direction

Start at AppInspector._initialize in inspector.dart, where the stack trace shows List.last failing because the libraries list is empty. Trace the DDC metadata read path and improve the logging and state error so the missing metadata condition is described clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.