koha debugging tips
The adoption of Carp was evoked during the last IRC meeting (looong time ago) but it is not used for the moment. So i want to share 2 tips with you:
First, Concider using Devel::SimpleTrace makes warn and die behave as Carp functions (using traces).
Second, koha have a weak error management (historical issue) and it can be very usefull for you developpers to have a warn that acts as a die (just during the developpement sessions). It can be done very easily by redefining the warn signal:
# warn now act as a die
$SIG{__WARN__} = sub { die @_ };
# so you can catch it!
eval { warn 'mispellers of the world, UNTIE' };
$@ and say qq(caught "$@");Related posts: