From: Mike Taylor Date: Thu, 8 Mar 2007 14:51:32 +0000 (+0000) Subject: Planned failure is now at the end of the search handler, not the beginning. X-Git-Tag: CPAN.1.12~100 X-Git-Url: http://git.indexdata.com/?p=simpleserver-moved-to-github.git;a=commitdiff_plain;h=5f9c85921dbdd7a27ce6d45e06c5ee8d20c755a1 Planned failure is now at the end of the search handler, not the beginning. (This gives more informative logging.) --- diff --git a/ztest.pl b/ztest.pl index c5bec85..ea330b0 100755 --- a/ztest.pl +++ b/ztest.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -## $Id: ztest.pl,v 1.16 2007-03-07 11:25:29 mike Exp $ +## $Id: ztest.pl,v 1.17 2007-03-08 14:51:32 mike Exp $ ## ------------------------------------------------------------------ ## ## Copyright (c) 2000-2004, Index Data. @@ -106,10 +106,6 @@ my $_counter = 0; sub my_search_handler { my $args = shift; - if ($_fail_frequency != 0 && ++$_counter % $_fail_frequency == 0) { - print "Exiting to be nasty to client\n"; - exit(1); - } my $data = [{ name => "Peter Dornan", title => "Spokesman", @@ -139,6 +135,10 @@ sub my_search_handler { $args->{HITS} = $hits; $session->{$set_id} = $data; $session->{__HITS} = $hits; + if ($_fail_frequency != 0 && ++$_counter % $_fail_frequency == 0) { + print "Exiting to be nasty to client\n"; + exit(1); + } }