Conversation
Replace NullPointerException with IllegalStateException containing a descriptive message when a worker receives an orchestration event for a type it doesn't have registered. This helps users understand that workers that don't support the requested orchestration type are connected to the task hub.
Verifies that executing an orchestration with an unregistered type produces a FAILED result with an IllegalStateException containing the orchestration name and guidance about mismatched workers.
Contributor
There was a problem hiding this comment.
Pull request overview
Improves worker-side diagnostics by replacing a cryptic NullPointerException with an explicit, descriptive exception when an orchestration event references an orchestration type that isn’t registered on the worker.
Changes:
- Add an explicit
IllegalStateExceptionwhen noTaskOrchestrationFactoryexists for the incoming orchestration name (including fallback to"*"). - Provide a more actionable error message that includes the orchestration type name and likely cause/remediation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
client/src/main/java/com/microsoft/durabletask/TaskOrchestrationExecutor.java
Outdated
Show resolved
Hide resolved
client/src/main/java/com/microsoft/durabletask/TaskOrchestrationExecutor.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
nytian
approved these changes
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue describing the changes in this PR
Replaces a cryptic
NullPointerException(Cannot invoke "TaskOrchestrationFactory.create()" because "factory" is null) with a descriptiveIllegalStateExceptionwhen a worker receives an orchestration event for a type it does not have registered.The new error message clearly states the orchestration type name and explains that this usually means workers that do not support this orchestration type are connected to the task hub.
This addresses the existing TODO at line 885 of
TaskOrchestrationExecutor.java.Pull request checklist
CHANGELOG.mdAdditional information
Before (cryptic):
After (descriptive):