]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/bugs/error_handlers_with_gettext_can_clobber___36____64__.mdwn
fix branch template, add Try::Tiny references
[git.ikiwiki.info.git] / doc / bugs / error_handlers_with_gettext_can_clobber___36____64__.mdwn
1 [[!template id=gitbranch branch=smcv/ready/careful-eval author="[[smcv]]"]]
2 [[!tag patch]]
4 As noted in the [[!cpan Try::Tiny]] man page, eval/$@ can be quite
5 awkward in corner cases, because $@ has the same properties and problems
6 as C's errno. While writing a regression test for definetemplate
7 in which it couldn't find an appropriate template, I received
8     
9     <span class="error">Error: failed to process template
10     <span class="createlink">deftmpl</span> </span>
11     
12 instead of the intended
13     
14     <span class="error">Error: failed to process template
15     <span class="createlink">deftmpl</span> template deftmpl not
16     found</span>
17     
18 which turned out to be because the "catch"-analogous block called
19 gettext before it used $@, and gettext can call define_gettext,
20 which uses eval.
22 Fixed in my branch smcv/ready/careful-eval. Another possibility
23 for fixing this would be to depend on something like Try::Tiny,
24 which is already indirectly recommended by ikiwiki, because
25 [[!cpan RPC::XML]], [[!cpan XML::Feed]], etc., depend on it.
26 --[[smcv]]