The Error type is being used to address an error during lexing, parsing or execution. If you want to return an error object (for example in your own tag or filter) fill this object with as much information as you have. Make sure "Sender" is always given (if you're returning an error within a filter,
| 13 | // a filter, make Sender equals 'filter:yourfilter'; same goes for tags: 'tag:mytag'). |
| 14 | // It's okay if you only fill in ErrorMsg if you don't have any other details at hand. |
| 15 | type Error struct { |
| 16 | Template *Template |
| 17 | Filename string |
| 18 | Line int |
| 19 | Column int |
| 20 | Token *Token |
| 21 | Sender string |
| 22 | OrigError error |
| 23 | } |
| 24 | |
| 25 | func (e *Error) updateFromTokenIfNeeded(template *Template, t *Token) *Error { |
| 26 | if e.Template == nil { |
nothing calls this directly
no outgoing calls
no test coverage detected