From 14b8749111441f0a039859ea276d1b1f7cb610fa Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 23 Apr 2014 06:12:07 -0400 Subject: [PATCH] add handling for the error happens in table resource operation --- xCAT-server/xCAT-wsapi/xcatws.cgi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index 2ff6abe39..c63a2b164 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -2339,7 +2339,11 @@ sub filterData { } if (defined ($_->{errorcode})) { - $outputerror->{errorcode} = $_->{errorcode}->[0]; + if (ref($_->{errorcode}) eq 'ARRAY') { + $outputerror->{errorcode} = $_->{errorcode}->[0]; + } else { + $outputerror->{errorcode} = $_->{errorcode}; + } } else { # set the default errorcode to '1' $outputerror->{errorcode} = '1';