|
@@ -513,6 +513,8 @@ public:
|
|
|
return;
|
|
|
if (slaves.ordinality()>1) {
|
|
|
PROGLOG("Results: (%d of %d finished)",done.ordinality(),slaves.ordinality());
|
|
|
+ int errCode = 0;
|
|
|
+ Owned<IMultiException> multiException = MakeMultiException();
|
|
|
for (unsigned i=0;i<done.ordinality();i++) {
|
|
|
unsigned n = done.item(i);
|
|
|
StringBuffer res(replytext.item(n));
|
|
@@ -520,19 +522,30 @@ public:
|
|
|
res.setLength(res.length()-1);
|
|
|
if (res.length()==0)
|
|
|
PROGLOG("%d: %s(%d): [OK]",n+1,slaves.item(n),reply.item(n));
|
|
|
- else if (strchr(res.str(),'\n')==NULL)
|
|
|
+ else if (strchr(res.str(),'\n')==NULL) {
|
|
|
PROGLOG("%d: %s(%d): %s",n+1,slaves.item(n),reply.item(n),res.str());
|
|
|
- else
|
|
|
+ if (reply.item(n)) {
|
|
|
+ errCode = reply.item(n);
|
|
|
+ multiException->append(*MakeStringExceptionDirect(reply.item(n),res.str()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
PROGLOG("%d: %s(%d):\n---------------------------\n%s\n===========================",n+1,slaves.item(n),reply.item(n),res.str());
|
|
|
+ if (reply.item(n)) {
|
|
|
+ errCode = reply.item(n);
|
|
|
+ multiException->append(*MakeStringExceptionDirect(reply.item(n),res.str()));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ if (errCode)
|
|
|
+ throw multiException.getClear();
|
|
|
}
|
|
|
else {
|
|
|
StringBuffer res(replytext.item(0));
|
|
|
while (res.length()&&(res.charAt(res.length()-1)<=' '))
|
|
|
res.setLength(res.length()-1);
|
|
|
PROGLOG("%s result(%d):\n%s",useplink?"plink":"ssh",reply.item(0),res.str());
|
|
|
- if (res.length())
|
|
|
- {
|
|
|
+ if (res.length()) {
|
|
|
int code = reply.item(0);
|
|
|
if (code == 0)
|
|
|
code = -1;
|