public void InvokeErrorEvent(LiquidError liquidError) { OnParsingErrorEventHandler handler = ParsingErrorEventHandler; if (handler != null) { handler(liquidError); } }
protected void OnParsingErrorEventHandler(LiquidError liquiderror) { var handler = ParsingErrorEventHandler; if (handler != null) { handler(liquiderror); } }
protected void OnRenderingErrorEventHandler(LiquidError args) { var handler = RenderingErrorEventHandler; if (handler != null) { handler(this, args); } }
private static string FormatError(LiquidError x) { // to remain backwards-compatible, this leaves "Liquid Error:" alone. String err = x.Message; if (!String.IsNullOrWhiteSpace(x.TokenSource)) { err = x.ToString(); } if (x.Message.IndexOf("Liquid error") >= 0) { return(err); } else { return("ERROR: " + err); } }
public void Visit(CustomTag customTag) { //Console.WriteLine("Looking up Custom Tag " + customTag.TagName); var tagType = _templateContext.SymbolTableStack.LookupCustomTagRendererType(customTag.TagName); if (tagType != null) { AppendTextToCurrentAccumulator(RenderCustomTag(customTag, tagType)); return; } //Console.WriteLine("Looking up Macro "+ customTag.TagName); var macroDescription = _templateContext.SymbolTableStack.LookupMacro(customTag.TagName); if (macroDescription != null) { //Console.WriteLine("..."); var evalResults = customTag.LiquidExpressionTrees.Select(x => LiquidExpressionEvaluator.Eval(x, _templateContext)).ToList(); if (evalResults.Any(x => x.IsError)) { var errors = evalResults.Where(x => x.IsError).Select(x => x.ErrorResult).ToList(); foreach (LiquidError error in errors) { RegisterRenderingError(error); } //RenderErrors(errors); return; } AppendTextToCurrentAccumulator(RenderMacro(macroDescription, evalResults.Select(x => x.SuccessResult))); return; } var err = new LiquidError { Message = "Liquid syntax error: Unknown tag '" + customTag.TagName + "'" }; //RenderError(err); RegisterRenderingError(err); }
private void RenderError(LiquidError liquidError) { AppendTextToCurrentAccumulator(FormatErrors(new List<LiquidError>{liquidError})); }
internal void RegisterParsingError(LiquidError error) { ParsingErrors.Add(error); RenderError(error); // write it inline OnParsingErrorEventHandler(error); }
private void RenderError(LiquidError liquidError) { RenderErrors(new List <LiquidError> { liquidError }); }