in aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/internal/servlet/AwsAsyncContext.java [159:178]
private void notifyListeners(NotificationType type, Throwable t) {
listeners.forEach((h) -> {
try {
switch (type) {
case COMPLETE:
case START_ASYNC:
case TIMEOUT:
h.getListener().onComplete(h.getAsyncEvent());
break;
case ERROR:
h.getListener().onError(h.getAsyncEvent(t));
break;
}
} catch (IOException e) {
if (type != NotificationType.ERROR) {
notifyListeners(NotificationType.ERROR, e);
}
}
});
}