Skip to content

[Bug] BaseException exceptions are not caught when raised in an activity #333

@joshua-auchincloss

Description

@joshua-auchincloss

What are you really trying to do?

  • raise an exception subclassed from BaseException in an activity

Describe the bug

The bug occurs when raising custom exceptions during an activity. the system raises TypeError -> exception causes must derive from BaseException, which overshadows the actual error

Minimal Reproduction

....

# also with normal Exception
class MyException(BaseException):
    def __init__(self, *args):
        super().__init__(*args)

@activity.defn
async def my_act():
    raise MyException("abc") from None


@workflow.defn
class Workflow:
    @workflow.run
    async def run(self):
          workflow.start_activity(
            my_act,
            ....
          )

Environment/Versions

  • OS and processor: m1 mac
  • Temporal Version: temporal @ 1.20.2, python sdk @ 1.2.0
  • Are you using Docker or Kubernetes or building Temporal from source? docker + build from wheel

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions