From 9c06ac9640613c153d1e8c7dac316e4d3d7a282e Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 8 Apr 2008 11:49:06 +0000 Subject: [PATCH] Add output to STDERR for error message in one more place in handle_response git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@998 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/Client.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/perl-xCAT-2.0/xCAT/Client.pm b/perl-xCAT-2.0/xCAT/Client.pm index 4aa3b8dfe..c21cb1de1 100644 --- a/perl-xCAT-2.0/xCAT/Client.pm +++ b/perl-xCAT-2.0/xCAT/Client.pm @@ -527,6 +527,7 @@ sub handle_response { } # Handle {node} structure + my $errflg=0; if (scalar @{$rsp->{node}}) { #print "printing node\n"; my $nodes=($rsp->{node}); @@ -539,6 +540,7 @@ sub handle_response { } if ($node->{error}) { $desc.=": Error: ".$node->{error}->[0]; + $errflg=1; } if ($node->{data}) { if (ref(\($node->{data}->[0])) eq 'SCALAR') { @@ -553,7 +555,11 @@ sub handle_response { } } if ($desc) { - print "$desc\n"; + if ($errflg == 1) { + print STDERR ("$desc\n"); + } else { + print "$desc\n"; + } } } }