<#3693 [BUG] Task fails when raised Exception has ...
# flyte-github
a
#3693 [BUG] Task fails when raised Exception has more than one argument Issue created by bstadlbauer Describe the bug The following example will fail with:
Copy code
TypeError: MyException.__init__() missing 1 required positional argument: 'foo'
Copy code
from flytekit import task


class MyException(Exception):
    def __init__(self, message, foo):
        pass


@task
def fail_task():
    raise MyException("a", "b")


if __name__ == "__main__":
    fail_task()
instead of correctly propagating the Exception Expected behavior The Exception should be propagated correctly Additional context to reproduce No response Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte