branaway / Japid

A Java-based statically-typed fast template engine that can be used in any Java code. It has special adapter for use with the Play! Framework.
113 stars 18 forks source link

Error message about "missing action" need to be improved #37

Closed freewind closed 13 years ago

freewind commented 13 years ago

In my template, I have this code:

<a href="@{Pages.xxx}">Edit</a>

which "Pages.xxx" in not existed. When I refresh the browser, it will report this error message:

 Execution exception

        RuntimeException occured : error in running the renderer: No route found  In /app/controllers/Pages.java (around line 39)

35: }
36:
37: public static void show(Long id) {
38: Page page = Page.findById(id);
39:     renderJapid(page);
40:     }
41: }

But from the message, I can't find any information about the "Pages.xxx", it's not easy to look for it in the template.

I think it's better to provide the action name and the line number of template in the error message.

branaway commented 13 years ago

Can you explain how you would invoke a missing action in the templates?

2011/9/27 freewind < reply@reply.github.com>

If I invoked an missing action in the template, the error message will be:

Execution exception

RuntimeException occured : error in running the renderer: No route found In /app/controllers/Pages.java (around line 39)

35: } 36: 37: public static void show(Long id) { 38: Page page = Page.findById(id); 39: renderJapid(page); 40: } 41: }

But from the message, I don't know which one is missing, it's not easy to look for it in the template.

I think it's better to provide the action name and the line number of template in the error message.

Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/issues/37

freewind commented 13 years ago

I just updated the issue, make it clearer.

branaway commented 13 years ago

the new version, 0.8.9.8, has a better error message. still not ideal, since it shows the lines in the generated Java code, instead of the original template file.

branaway commented 13 years ago

0.8.10 has enhanced template runtime errors quite a bit. The error is mapped to the original template. A lot informative. All templates must be recompiled with japid:regen