Log in

No account? Create an account
Dear hackers - Artur Bergman [entries|archive|friends|userinfo]
Artur Bergman

[ website | O'Reilly Radar ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Dear hackers [Jul. 30th, 2006|03:36 pm]
Artur Bergman
For love of god,

            my $handler = $self->{can}{$func};
            my $ret = eval { $handler->($job); };

            my $work_req;
            if (defined $ret) {
                $work_req = Gearman::Util::pack_req_command("work_complete", "$handle\0" . (ref $ret ? $$ret : $ret));
            } else {
                $work_req = Gearman::Util::pack_req_command("work_fail", $handle);

Can someone tell me what is wrong with this code?

Oh right, someone, brad, is doing an eval {} and never looking at the error, so the handy error message, that tells ops people and developers alike, what is actually happening, instead it ignores the error and just return failed.

If you use eval {}, check the $@ or don't use an eval {}

[User Picture]From: 2shortplanks
2006-07-31 08:55 am (UTC)
flipping Perl and it's fricking non-auto-rethrowing-not-caught-errors try blocks.

I hates it.
(Reply) (Thread)