<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="moz-cite-prefix">On 26/12/2025 11:01, Kasper Nielsen
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CAPs6151+HFK_9TorGmz2qGFbR-pqtbr9zyBWxXneGcwVDLFHTQ@mail.gmail.com">
<pre wrap="" class="moz-quote-pre">Hi,
I encountered a WrongThreadException the other day from invalid use of
StructuredTaskScope. However, finding out why was a bit more difficult
than needed. I had to fire up a debugger to get the owning thread of
my StructuredTaskScope. It would have been somewhat easier to figure
out what exactly went wrong if StructuredTaskScopeImpl.ensureOwner
included the name of both the owning thread, and the current thread in
its error message.
</pre>
</blockquote>
<br>
We can look at improving the exception message but I'm curious how
you ran into this, was it a subtask getting a reference to its
parent's scope or something more complicated?<br>
<br>
-Alan<br>
</body>
</html>