Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
package software.amazon.lambda.durable.exception;

import software.amazon.awssdk.services.lambda.model.ErrorObject;
import software.amazon.awssdk.services.lambda.model.Operation;

/**
Expand All @@ -13,7 +14,13 @@
public class WaitForConditionFailedException extends DurableOperationException {

public WaitForConditionFailedException(String message) {
super(null, null, message);
super(
null,
ErrorObject.builder()
.errorType(WaitForConditionFailedException.class.getName())
.errorMessage(message)
.build(),
message);
}

public WaitForConditionFailedException(Operation operation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ void exponentialBackoff_maxAttemptsExceeded_throwsException() {
var exception = assertThrows(WaitForConditionFailedException.class, () -> strategy.evaluate("x", 3));
assertTrue(exception.getMessage().contains("maximum attempts"));
assertTrue(exception.getMessage().contains("3"));
assertNotNull(exception.getErrorObject());
assertEquals(exception.getMessage(), exception.getErrorObject().errorMessage());
assertEquals(
WaitForConditionFailedException.class.getName(),
exception.getErrorObject().errorType());
}

@RepeatedTest(10)
Expand Down