Skip to content

Exceptions raised in Spawned cothread can be lost #40

@Araneidae

Description

@Araneidae

The Spawn option raise_on_wait causes reporting of any exception terminating the spawned cothread to be deferred until .Wait() is called on the associated cothread, for instance:

def task(): raise Exception('Die')
def test():
    action = Spawn(task, raise_on_wait = True)
    action.Wait()

Unfortunately if .Wait() is never called then the associated exception is never reported.

It might be possible to fix this by added a __del__ method to Spawn and reporting any exception that hasn't already been reported.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions