Template code Chunk output
{#example_1}
{!-- special error trapping: see Java tab --}
{#}
Theme theme = new Theme();

// Let's hide all errors from appearing in rendered output.
// Instead, we'll log errors to STDERR.
theme.setErrorHandling(false, System.err);

// Load up the main template in [classpath]/themes/my_template.html
// This file does not exist, so it should raise an error.
Chunk html = theme.makeChunk("my_template");

return html.toString();
Template code Chunk output
{#example_2}
{!-- default error handling: see Java tab --}
{#}
Theme theme = new Theme();

// Load up the main template in [classpath]/themes/my_template.html
// This file does not exist, so it should raise an error.
Chunk html = theme.makeChunk("my_template");

return html.toString();
[chtml template 'my_template' not found]<!-- looked in [themes/2.4/examples/my_template.chtml] -->
[chtml template 'my_template' not found]