Skip to content

WorkflowStub.cancel throws wrong exception #2781

@enlait

Description

@enlait

Expected Behavior

WorkflowStub.cancel methods are documented to throw a WorkflowNotFoundException if a workflow does not exist or is already completed

Actual Behavior

A different exception is thrown in explicit internal check and propagated up:

java.lang.IllegalStateException: Null workflowId. Was workflow started?
  at io.temporal.client.WorkflowStubImpl.checkStarted(WorkflowStubImpl.java:500)
  at io.temporal.client.WorkflowStubImpl.cancel(WorkflowStubImpl.java:446

Steps to Reproduce the Problem

  1. try to cancel workflow with non-existent id

Specifications

  • Version: Temporal Java SDK 1.32.0
  • Platform:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions