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';