From: Thorsten S. <tsc...@am...> - 2010-06-22 15:57:57
|
Guten Tag Thorsten Schöning, am Dienstag, 22. Juni 2010 um 12:18 schrieben Sie: > Now I have the problem again and hunted it down to an eval{} in the > Package DBIx::Log4perl::db. I've tested my code again and it seems I have this problem: http://search.cpan.org/~elliotjs/Perl-Critic-1.106/lib/Perl/Critic/Policy/ErrorHandling/RequireCheckingReturnValueOfEval.pm I do have DESTROY which is always called and calls DBIx::Log4perl::db::disconnect indirectly while disocnnecting from the database. In this function eval is used successfully, which resets $@ and SOAP-Lite can't detect the former die anymore, which let the code stop because of an error. What I don't understand is, if I do a eval{} myself to catch the exception and save $@ in a variable, $@ doesn't seem to be reset. If I die directly in that eval again, no matter if I die with $@ or something else, SOAP-Lite sends an empty response again. Won't work: eval { someClass->new()->someMethod(); } or die 'test'; [download] Does work: my $retVal = undef; eval { someClass->new()->someMethod(); } or $retVal = SOAP::Fault->new(faultstring => $@); die $retVal; [download] $retVal will have the proper message from $@ from the die in someMethod. I would have expected that $@ is always cleared because of DESTROY is always called in the eval above. Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig Telefon: Potsdam: 0331-743881-0 E-Mail: tsc...@am... Web: http://www.am-soft.de AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow |