X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=1f631120800c42db0de01096540941b08d981d48;hb=63f0fc26e717837bc7c6990f27d26de91d65eb7e;hp=6d20b887407984956129ac06a22656078c6330a7;hpb=0ece4187fe1d9f4547cb262d91af55f17bea200c;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 6d20b887..1f631120 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -1218,21 +1218,31 @@ sub spawn_cmd my $fc = Mojo::IOLoop::Subprocess->new; # just behave normally if something has set the "one-shot" _nospawn in the channel - return ($cmdref->(@$args)) if $self->{_nospawn}; + if ($self->{_nospawn}) { + eval { @out = $cmdref->(@$args); }; + if ($@) { + DXDebug::dbgprintring(25); + push @out, DXDebug::shortmess($@); + } + return @out; + } # $fc->serializer(\&encode_json); # $fc->deserializer(\&decode_json); $fc->run( sub { my $subpro = shift; - if (isdbg('chan')) { + if (isdbg('progress')) { my $s = "line: $line"; $s .= ", args: " . join(', ', @$args) if $args && @$args; + dbg($s); } - - my @res = $cmdref->(@$args); -# diffms("by $call 1", $line, $t0, scalar @res) if isdbg('chan'); - return @res; + eval { @out = $cmdref->(@$args); }; + if ($@) { + DXDebug::dbgprintring(25); + push @out, DXDebug::shortmess($@); + } + return @out; }, # $args, sub {