… | |
… | |
444 | call site. |
444 | call site. |
445 | |
445 | |
446 | This is a popular choice, but it makes handling errors hard - make sure |
446 | This is a popular choice, but it makes handling errors hard - make sure |
447 | you never generate protocol errors! |
447 | you never generate protocol errors! |
448 | |
448 | |
449 | If an C<on_failure> hook exists, it will be invoked with the FCP object, |
449 | In the failure case, if an C<on_failure> hook exists, it will be invoked |
450 | the request type (the name of the method), a (textual) backtrace as |
450 | with the FCP object, the request type (the name of the method), a |
451 | generated by C<Carp::longmess>, and arrayref containing the arguments from |
451 | (textual) backtrace as generated by C<Carp::longmess>, and arrayref |
452 | the original request invocation and the error object from the server, in |
452 | containing the arguments from the original request invocation and the |
453 | this order, e.g.: |
453 | error object from the server, in this order, e.g.: |
454 | |
454 | |
455 | on_failure => sub { |
455 | on_failure => sub { |
456 | my ($fcp, $request_type, $backtrace, $orig_args, $error_object) = @_; |
456 | my ($fcp, $request_type, $backtrace, $orig_args, $error_object) = @_; |
457 | |
457 | |
458 | warn "FCP failure ($type), $error_object->{code_description} ($error_object->{extra_description})$backtrace"; |
458 | warn "FCP failure ($type), $error_object->{code_description} ($error_object->{extra_description})$backtrace"; |