Skip to content

Commit 1dd179e

Browse files
committed
update example for waitforcallback
1 parent 62a8dcf commit 1dd179e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

examples/src/main/java/software/amazon/lambda/durable/examples/callback/WaitForCallbackFailedExample.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ public String handleRequest(ApprovalRequest input, DurableContext context) {
3232
.serDes(new FailedSerDes())
3333
.build())
3434
.build());
35-
} catch (Exception ex) {
35+
} catch (SuspendExecutionException e) {
3636
// not to swallow the SuspendExecutionException
37-
if (ex instanceof SuspendExecutionException suspendExecutionException) {
38-
throw suspendExecutionException;
39-
}
37+
throw e;
38+
} catch (Exception ex) {
4039
return ex.getClass().getSimpleName() + ":" + ex.getMessage();
4140
}
4241

0 commit comments

Comments
 (0)