Comments (5)
All pongo error messages should provide a proper information like line/col and filename. Can you please give concrete examples where it does not?
from pongo2.
panic: [Parse Error in <string> | Line 1 Col 12 (<Token Typ=String (5) Val='head' Line=1 Col=12>)] '}}' expected
goroutine 16 [running]:
runtime.panic(0x7a1b40, 0xc082001140)
C:/Go/src/pkg/runtime/panic.c:279 +0x11f
github.com/flosch/pongo2.Must(0x0, 0x35c190, 0xc082001140, 0x35c190)
E:/gopath/src/github.com/flosch/pongo2/pongo2.go:12 +0x56
github.com/macaron-contrib/pongo2.func·001(0xc082009a40, 0x19, 0x3608d8, 0xc082015200, 0x0, 0x0, 0x0, 0x0)
E:/gopath/src/github.com/macaron-contrib/pongo2/pongo2.go:87 +0x2df
path/filepath.walk(0xc082009a40, 0x19, 0x3608d8, 0xc082015200, 0xc082055c08, 0x0, 0x0)
C:/Go/src/pkg/path/filepath/path.go:343 +0x93
path/filepath.walk(0x868ed0, 0x9, 0x3608d8, 0xc082014a20, 0xc082055c08, 0x0, 0x0)
C:/Go/src/pkg/path/filepath/path.go:368 +0x4fc
path/filepath.Walk(0x868ed0, 0x9, 0xc082055c08, 0x0, 0x0)
C:/Go/src/pkg/path/filepath/path.go:390 +0xec
github.com/macaron-contrib/pongo2.compile(0x868ed0, 0x9, 0xc0820096e0, 0x2, 0x2, 0x833f30, 0x5, 0x101, 0x0, 0x0, ...)
E:/gopath/src/github.com/macaron-contrib/pongo2/pongo2.go:93 +0xc9
github.com/macaron-contrib/pongo2.Pongoer(0xc082055ec8, 0x1, 0x1, 0x0, 0x0)
E:/gopath/src/github.com/macaron-contrib/pongo2/pongo2.go:148 +0x18e
main.main()
E:/gopath/src/flower/app.go:24 +0x1f6
goroutine 19 [finalizer wait]:
runtime.park(0x415a40, 0xa78cf8, 0xa76669)
C:/Go/src/pkg/runtime/proc.c:1369 +0xac
runtime.parkunlock(0xa78cf8, 0xa76669)
C:/Go/src/pkg/runtime/proc.c:1385 +0x42
runfinq()
C:/Go/src/pkg/runtime/mgc0.c:2644 +0xdd
runtime.goexit()
C:/Go/src/pkg/runtime/proc.c:1445
goroutine 37 [runnable]:
text/template/parse.lexText(0xc082028a00, 0x90bb40)
C:/Go/src/pkg/text/template/parse/lex.go:228 +0x388
text/template/parse.(*lexer).run(0xc082028a00)
C:/Go/src/pkg/text/template/parse/lex.go:198 +0x47
created by text/template/parse.lex
C:/Go/src/pkg/text/template/parse/lex.go:191 +0x119
This is the error message data for me, but I can't see template error file path.
from pongo2.
The reason for that lies here:
https://github.com/macaron-contrib/pongo2/blob/master/pongo2.go#L87
There is no filename provided to pongo2, so it can't output any. If you're working on macaron-contrib, then it would be useful if you would use pongo2.FromFile
instead of pongo2.FromString
. pongo2 will then output proper error messages with filenames in it.
If you're not working on macaron-contrib, you want to file an issue in their issue tracker.
from pongo2.
Thank you very much for your tips. I've told Unknwon , this problem has been solved. The error message has been correctly the output file path.
panic: [Parse Error in templates\CreateNode.html | Line 1 Col 12 (<Token Typ=String (5) Val='head' Line=1 Col=12>)] '}}' expected
from pongo2.
You're welcome!
from pongo2.
Related Issues (20)
- Cannot using template.Fromfile HOT 1
- Context key invalid HOT 1
- How to convert golang array to javascript array HOT 1
- Why this is no document about how to use it ?? HOT 8
- Struct field names in templates / contexts
- Data race in `pongo2.FromFile()` method HOT 5
- Potential security issue HOT 3
- date filter does not work as expected HOT 4
- Array in yml file as context is not supported
- Macro that invokes other macros does not work when imported HOT 1
- Not compatible with GCCGO 13.0.0 HOT 1
- How can pongo2 does not escape chars which except TokenSymbols?
- Bug: random order for `for` loop. HOT 2
- Include statement doesn't work inside for loop
- Returning only a partial block
- Potential BC break on master (missing var comparison)
- BC break between v4 and v6 (string/num adding/concatenating)
- question about split filter on new line
- need strings function HOT 1
- What tags deos pongo uses of declared structs struct?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pongo2.