code: @Trivial
      private static final OnError ignoreWarnOrFail() {
          String value = null;
          BundleContext bundleContext = priv.getBundleContext(FrameworkUtil.getBundle(VariableRegistry.class));
          ServiceReference<VariableRegistry> ref = priv.getServiceReference(bundleContext, VariableRegistry.class);
          VariableRegistry variableRegistry = priv.getService(bundleContext, ref);
          try {
              String key = "${" + OnErrorUtil.CFG_KEY_ON_ERROR + "}";
              value = variableRegistry.resolveString(key);
              if (!key.equals(value))
                  return OnError.valueOf(value.trim().toUpperCase());
          } catch (Exception x) {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                  Tr.debug(tc, "onError: " + value, x);
          } finally {
              bundleContext.ungetService(ref);
          }
          return OnErrorUtil.getDefaultOnError();
      }
docs: Utility method that gets the onError setting.
  This method should be invoked every time it is needed in order to allow for
  changes to the onError setting.
  
  @return the onError setting if configured. Otherwise the default value.