Skip to content

Have a way to get the current stack trace without throwing exceptions. #4061

Closed
@nex3

Description

@nex3

There's currently no way to get the full, current stack trace. This means that there's also no way for an asynchronous method to give an accurate stack trace when it has an error. For example:

  Future<String> getLinks(String url) {
    return fetchPage(url).transform((html) => parseLinks(html));
  }

Now suppose fetchPage detects an error asynchronously and wants to display a stack trace for that error. A useful stack trace would show that it had originally been called by getLinks, but there's no way for it to know that.

Metadata

Metadata

Assignees

Labels

P3A lower priority bug or feature requestarea-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).type-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions