File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed
src/main/java/com/networknt/aws/lambda Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -216,9 +216,9 @@ public APIGatewayProxyResponseEvent getFinalizedResponse(boolean fromListener) {
216216 }
217217 /*
218218 * Check for failures first because a failed request could mean
219- * that we never set the response in the first place.
219+ * that we never set the response in the first place. If response is not null, don't bother.
220220 */
221- if (stateHasAnyFlags (FLAG_REQUEST_HAS_FAILURE | FLAG_RESPONSE_HAS_FAILURE )) {
221+ if (stateHasAnyFlags (FLAG_REQUEST_HAS_FAILURE | FLAG_RESPONSE_HAS_FAILURE ) && response == null ) {
222222 LOG .error ("Exchange has an error, returning middleware status." );
223223 this .state |= FLAG_RESPONSE_DONE ;
224224 return ExceptionUtil .convert (this .executor .getChainResults ());
Original file line number Diff line number Diff line change 11package com .networknt .aws .lambda .handler .middleware ;
22import com .amazonaws .services .lambda .runtime .events .APIGatewayProxyResponseEvent ;
3- import com .fasterxml .jackson .core .JsonProcessingException ;
4- import com .fasterxml .jackson .databind .ObjectMapper ;
53import com .networknt .aws .lambda .utility .HeaderKey ;
64import com .networknt .aws .lambda .utility .HeaderValue ;
75import com .networknt .status .Status ;
86
9- import java .util .ArrayList ;
107import java .util .HashMap ;
118import java .util .List ;
129
1613 *
1714 */
1815public class ExceptionUtil {
19-
20- private static final String DATA_KEY = "data" ;
21- private static final String NOTIFICATIONS_KEY = "notifications" ;
22-
23- private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper ();
24-
2516 /**
2617 * Convert the middleware results to APIGatewayProxyResponseEvent
2718 *
You can’t perform that action at this time.
0 commit comments