MCPcopy
hub / github.com/flosch/pongo2 / Error

Method Error

error.go:42–59  ·  view source on GitHub ↗

Returns a nice formatted error string.

()

Source from the content-addressed store, hash-verified

40
41// Returns a nice formatted error string.
42func (e *Error) Error() string {
43 s := "[Error"
44 if e.Sender != "" {
45 s += " (where: " + e.Sender + ")"
46 }
47 if e.Filename != "" {
48 s += " in " + e.Filename
49 }
50 if e.Line > 0 {
51 s += fmt.Sprintf(" | Line %d Col %d", e.Line, e.Column)
52 if e.Token != nil {
53 s += fmt.Sprintf(" near '%s'", e.Token.Val)
54 }
55 }
56 s += "] "
57 s += e.OrigError.Error()
58 return s
59}
60
61// RawLine returns the affected line from the original template, if available.
62func (e *Error) RawLine() (line string, available bool, outErr error) {

Callers 15

tagForParserFunction · 0.45
tagNowParserFunction · 0.45
tagTemplateTagParserFunction · 0.45
ExecuteMethod · 0.45
tagIncludeParserFunction · 0.45
callMethod · 0.45
tagMacroParserFunction · 0.45
tagIfEqualParserFunction · 0.45
tagCycleParserFunction · 0.45
tagWidthratioParserFunction · 0.45
tagCommentParserFunction · 0.45
TestMiscMethod · 0.45

Calls

no outgoing calls

Tested by 6

TestMiscMethod · 0.36
TestTemplate_FunctionsFunction · 0.36
TestTemplatesFunction · 0.36
TestBlockTemplatesFunction · 0.36
TestExecutionErrorsFunction · 0.36
TestCompilationErrorsFunction · 0.36