I can't find anything in the docs how the following behavior is defined
// task-less context
Task.detached {
try await myThrowingFunction()
runWhenSuccessful()
}
The method returns on the throwing line and discards the error and runWhenSuccessful() will never be called. While it makes sense in some way, I at least expected it to trigger an assertion failure or something for the unhandled error.
What is the correct way to deal with this, since I can't handle errors in any parent task.
Am I expected to wrap everything in the closure in a do/catch every time?