Artur Bergman (crucially) wrote,
Artur Bergman
crucially

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 {}
Subscribe
  • Post a new comment

    Error

    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