private OnError getOnError() {

        VariableRegistry variableRegistry = variableRegistryTracker.getService();

        OnError onError;
        String onErrorVar = "${" + OnErrorUtil.CFG_KEY_ON_ERROR + "}";
        String onErrorVal = variableRegistry.resolveString(onErrorVar);

        if ((onErrorVal.equals(onErrorVar))) {
            onError = OnErrorUtil.OnError.WARN; // Default value if not set
        } else {
            String onErrorFormatted = onErrorVal.trim().toUpperCase();
            try {
                onError = Enum.valueOf(OnErrorUtil.OnError.class, onErrorFormatted);
                // Correct the variable registry with a validated entry if needed
                if (!onErrorVal.equals(onErrorFormatted))
                    variableRegistry.replaceVariable(OnErrorUtil.CFG_KEY_ON_ERROR, onErrorFormatted);
            } catch (IllegalArgumentException err) {
                if (tc.isWarningEnabled()) {
                    Tr.warning(tc, "warn.config.invalid.value", OnErrorUtil.CFG_KEY_ON_ERROR, onErrorVal, OnErrorUtil.CFG_VALID_OPTIONS);
                }
                onError = OnErrorUtil.OnError.WARN; // Default value if error
                variableRegistry.replaceVariable(OnErrorUtil.CFG_KEY_ON_ERROR, OnErrorUtil.OnError.WARN.toString());
            }
        }
        return onError;
    }
private OnError getOnError ( ) { VariableRegistry variableRegistry = variableRegistryTracker . getService ( ) ; OnError onError ; String onErrorVar = "${" + OnErrorUtil . CFG_KEY_ON_ERROR + "}" ; String onErrorVal = variableRegistry . resolveString ( onErrorVar ) ; if ( ( onErrorVal . equals ( onErrorVar ) ) ) { onError = OnErrorUtil . OnError . WARN ; } else { String onErrorFormatted = onErrorVal . trim ( ) . toUpperCase ( ) ; try { onError = Enum . valueOf ( OnErrorUtil . OnError . class , onErrorFormatted ) ; if ( ! onErrorVal . equals ( onErrorFormatted ) ) variableRegistry . replaceVariable ( OnErrorUtil . CFG_KEY_ON_ERROR , onErrorFormatted ) ; } catch ( IllegalArgumentException err ) { if ( tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "warn.config.invalid.value" , OnErrorUtil . CFG_KEY_ON_ERROR , onErrorVal , OnErrorUtil . CFG_VALID_OPTIONS ) ; } onError = OnErrorUtil . OnError . WARN ; variableRegistry . replaceVariable ( OnErrorUtil . CFG_KEY_ON_ERROR , OnErrorUtil . OnError . WARN . toString ( ) ) ; } } return onError ; }
@return