Giter Club home page Giter Club logo

Comments (5)

flosch avatar flosch commented on May 11, 2024

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.

insionng avatar insionng commented on May 11, 2024
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.

flosch avatar flosch commented on May 11, 2024

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.

insionng avatar insionng commented on May 11, 2024

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.

flosch avatar flosch commented on May 11, 2024

You're welcome!

from pongo2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.