Artur Bergman (crucially) wrote,
Artur Bergman

Dear hackers

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 {}

  • Unix and LJTalk love

    echo 'users' | nc -q 1 5200 | cut -d '/' -f 2 | sort | uniq -c | sort -b -n -r 199 Miranda 182 Gaim 153 Adium 117 Psi 113 Trillian…

  • djabberd update

    While brad was away skiing I hacked a bit on djabberd, primarily making it work using Log4perl to manage the insane amount of debuglog…

  • (no subject)

    What is so awesome about It seems utterly retarded, and the flowchart doesn't make sense. I guess at least it…

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment