code: public RenderResult renderForResult(String template, Map<String, ?> bindings, JinjavaConfig renderConfig) {
      Context context = new Context(globalContext, bindings, renderConfig.getDisabled());
  
      JinjavaInterpreter parentInterpreter = JinjavaInterpreter.getCurrent();
      if (parentInterpreter != null) {
        renderConfig = parentInterpreter.getConfig();
      }
  
      JinjavaInterpreter interpreter = new JinjavaInterpreter(this, context, renderConfig);
      JinjavaInterpreter.pushCurrent(interpreter);
  
      try {
        String result = interpreter.render(template);
        return new RenderResult(result, interpreter.getContext(), interpreter.getErrorsCopy());
      } catch (InterpretException e) {
        if (e instanceof TemplateSyntaxException) {
          return new RenderResult(TemplateError.fromException((TemplateSyntaxException) e), interpreter.getContext(), interpreter.getErrorsCopy());
        }
        return new RenderResult(TemplateError.fromSyntaxError(e), interpreter.getContext(), interpreter.getErrorsCopy());
      } catch (InvalidArgumentException e) {
        return new RenderResult(TemplateError.fromInvalidArgumentException(e), interpreter.getContext(), interpreter.getErrorsCopy());
      } catch (InvalidInputException e) {
        return new RenderResult(TemplateError.fromInvalidInputException(e), interpreter.getContext(), interpreter.getErrorsCopy());
      }
      catch (Exception e) {
        return new RenderResult(TemplateError.fromException(e), interpreter.getContext(), interpreter.getErrorsCopy());
      } finally {
        globalContext.reset();
        JinjavaInterpreter.popCurrent();
      }
    }
docs: Render the given template using the given context bindings. This method returns some metadata about the render process, including any errors which may have been encountered such as unknown variables or syntax errors. This method will
  not throw any exceptions; it is up to the caller to inspect the renderResult.errors collection if necessary / desired.
  
  @param template
  jinja source template
  @param bindings
  map of objects to put into scope for this rendering action
  @param renderConfig
  used to override specific config values for this render operation
  @return result object containing rendered output, render context, and any encountered errors