You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powertools-idempotency/src/main/java/software/amazon/lambda/powertools/idempotency/internal/IdempotentAspect.java
@@ -59,8 +55,24 @@ public Object around(ProceedingJoinPoint pjp,
59
55
if (method.getReturnType().equals(void.class)) {
60
56
thrownewIdempotencyConfigurationException("The annotated method doesn't return anything. Unable to perform idempotency on void return type");
61
57
}
62
-
JsonNodepayload = null;
63
58
59
+
JsonNodepayload = getPayload(pjp, method);
60
+
if (payload == null) {
61
+
thrownewIdempotencyConfigurationException("Unable to get payload from the method. Ensure there is at least one parameter or that you use @IdempotencyKey");
// handleRequest or method with one parameter: get the first one
65
77
if ((isHandlerMethod(pjp) && placedOnRequestHandler(pjp))
66
78
|| pjp.getArgs().length == 1) {
@@ -77,12 +89,6 @@ public Object around(ProceedingJoinPoint pjp,
77
89
}
78
90
}
79
91
}
80
-
81
-
if (payload == null) {
82
-
thrownewIdempotencyConfigurationException("Unable to get payload from the method. Ensure there is at least one parameter or that you use @IdempotencyKey");
0 commit comments