koha debugging tips

Par mc, 27 avril 2009 11 h 28 min

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:

  1. use Carp … et Devel::SimpleTrace
  2. add js behaviors to koha
  3. vider koha
  4. edit koha code with vim
  5. the state of koha for macports

Laisser un commentaire

Panorama Theme by Themocracy