bungle / lua-resty-template

Templating Engine (HTML) for Lua and OpenResty.
BSD 3-Clause "New" or "Revised" License
904 stars 204 forks source link

how try catch template runtime exception #15

Closed sosojustdo closed 8 years ago

sosojustdo commented 8 years ago

lua-resty-template using, if you program have runtime exception I want try catch exception, how to do somthing? for instance catch exception redirect to error page。

bungle commented 8 years ago

Use Lua pcall or xpcall. I have been thinking about adding safe-mode with better error messages to template, but it needs some thinking still.

sosojustdo commented 8 years ago

Thank you very much @bungle