public static HandlerErrorCode translateExceptionIntoErrorCode()

in aws-wafv2-commons/src/main/java/com/amazonaws/wafv2/commons/ExceptionTranslationWrapper.java [67:78]


    public static HandlerErrorCode translateExceptionIntoErrorCode(RuntimeException error) {
        //based on CFN contract, we should throw HandlerErrorCode.NotFound if we are missing critical info
        if (error instanceof Wafv2Exception
                && error.getMessage() != null
                && error.getMessage().startsWith(MISSING_CRITICAL_INFO)) {
            return HandlerErrorCode.NotFound;
        }

        HandlerErrorCode translatedErrorCode = MAPPING.get(error.getClass());

        return translatedErrorCode == null ? HandlerErrorCode.GeneralServiceException : translatedErrorCode;
    }