if (objAnswer != null) {
Ok objOK = objAnswer.getOk();
ERROR objERROR = objAnswer.getERROR();
String errMsg = "unknown error";
if (objOK != null) {
throw new JSCommandOKException();
}
else if (objERROR != null) {
errMsg = objERROR.getText();
}
throw new JSCommandErrorException(errMsg);