freemarker-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Albert Kam <moonblade.w...@gmail.com>
Subject Re: Rethrow error after recover block ?
Date Sat, 21 May 2016 16:54:55 GMT
Hello,

That did cross my mind, but i was thinking of storing debugging values
to a global debugging variable, and upon <#recover>, i would like to
'dump' all the values to system.out.

I'm afraid using the usual way i wont be able to access the global
debugging value ?

Thank you.

On Sat, May 21, 2016 at 10:18 PM, Daniel Dekany <ddekany@freemail.hu> wrote:
> There's nothing built in for re-throwing... but since you want to
> terminate the whole template processing, couldn't you just use a
> TemplateExceptionHandler instead (see
> http://freemarker.org/docs/pgui_config_errorhandling.html)?
>
>
> Saturday, May 21, 2016, 3:00:32 PM, Albert Kam wrote:
>
>> Hi,
>>
>> My intention is to print out some values upon <#recover> block, and
>> rethrow the error without continuing the processes.
>>
>> <#macro xxx>
>>
>> <#attempt>
>>     <#-- main() -->
>> <#recover>
>>     <#-- print out messages here -->
>>     <#-- rethrow error, ***how to do this *** -->
>> </#attempt>
>> <#-- so that we dont continue processing the lines here -->
>>
>> </#macro>
>>
>> Thank you !
>>
>
> --
> Thanks,
>  Daniel Dekany
>



-- 
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)

Mime
View raw message