Repository navigation
fix: populate ErrorObject on WaitForConditionFailedException - #880
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
The message-only constructor passed null for the ErrorObject, so a waitForCondition that exhausted its attempts surfaced a FAILED invocation with no error details. Build an ErrorObject from the message, matching IllegalDurableOperationException. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Fixes #634
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue Link, if available
#634
Description
When
waitForConditionexhausts its attempts, the built-in wait strategies (WaitStrategies.java) throwWaitForConditionFailedException(String message). That constructor calledsuper(null, null, message), so the exception carried a nullErrorObject.WaitForConditionOperation.handleCheckFailure(),ChildContextOperationandDurableExecutor.buildErrorObject()all returngetErrorObject()as-is, so the step, the enclosing child context and the root invocation endedFAILEDwith no error.The fix builds the
ErrorObject(error type + message) in that constructor, the same wayIllegalDurableOperationException(String)does. The downstream paths then get a non-null error without any change.Demo/Screenshots
N/A
Design
DurableExecutor.buildErrorObject(),handleCheckFailure()andChildContextOperation. That adds a branch at three read sites; fixing the one constructor that produces the null covers all three without new branches.WaitForConditionFailedException(String)passednullas theErrorObject.Assumptions
None about the service, Lambda or other libraries; the change is local to the SDK exception.
Decisions not covered by the issue or the design note
errorTypeisWaitForConditionFailedException's class name anderrorMessageis the exception message; noerrorData/stackTrace, matchingIllegalDurableOperationException.Checklist
Testing
Unit Tests
Yes.
WaitStrategiesTest.exponentialBackoff_maxAttemptsExceeded_throwsExceptiongains assertions that the thrown exception has a non-nullErrorObjectwith the expected type and message (no existing expectation edited). Without the fix it fails withexpected: not <null>at line 66; with the fixmvn -pl sdk test -Dtest=WaitStrategiesTestpasses (530 tests).Integration Tests
No; the failure path downstream of the exception is unchanged.
Examples
Not applicable.
This change was prepared with the assistance of an AI coding tool (Claude) and submitted by the account owner.