my $msg = shift;
return unless ($self and $self->session and !$self->complete);
- my $response;
- if (ref($msg) && UNIVERSAL::isa($msg, 'OpenSRF::DomainObject::oilsResult')) {
- $response = $msg;
- } else {
- $response = new OpenSRF::DomainObject::oilsResult;
- $response->content($msg);
- }
-
- push @{$self->{current_chunk}}, $response;
+ if (defined($msg)) {
+ my $response;
+ if (ref($msg) && UNIVERSAL::isa($msg, 'OpenSRF::DomainObject::oilsResult')) {
+ $response = $msg;
+ } else {
+ $response = new OpenSRF::DomainObject::oilsResult;
+ $response->content($msg);
+ }
+
+ push @{$self->{current_chunk}}, $response;
+ }
my $stat = OpenSRF::DomainObject::oilsConnectStatus->new(
statusCode => STATUS_COMPLETE(),
status => 'Request Complete' );
-
$self->session->send( ( map { ('RESULT', $_) } @{$self->{current_chunk}} ), 'STATUS' => $stat, $self->threadTrace);
$self->complete(1);
}
my $time = sprintf '%.3f', time() - $start;
$log->debug( "Method duration for [$method_name]: ". $time );
- if( defined( $resp ) ) {
- $appreq->respond_complete( $resp );
- } else {
- $appreq->status( OpenSRF::DomainObject::oilsConnectStatus->new(
- statusCode => STATUS_COMPLETE(),
- status => 'Request Complete' ) );
- }
+ $appreq->respond_complete( $resp );
+
} catch Error with {
my $e = shift;
warn "Caught error from 'run' method: $e\n";
$log->debug( "Method duration for [".$aref->[2]->api_name." -> ".join(', ',@{$aref->[1]}).']: '.$time, DEBUG );
$appreq = $aref->[0];
- if( ref( $response ) ) {
- $appreq->respond_complete( $response );
- } else {
- $appreq->status( OpenSRF::DomainObject::oilsConnectStatus->new(
- statusCode => STATUS_COMPLETE(),
- status => 'Request Complete' ) );
- }
+ $appreq->respond_complete( $response );
$log->debug( "Executed: " . $appreq->threadTrace, INTERNAL );
+
} catch Error with {
my $e = shift;
if(UNIVERSAL::isa($e,"Error")) {