Replacing throw error with exit statements for now to handle fatal errors when commun...
authorrtrimana <rtrimana@uci.edu>
Sat, 26 Nov 2016 03:42:41 +0000 (19:42 -0800)
committerrtrimana <rtrimana@uci.edu>
Sat, 26 Nov 2016 03:42:41 +0000 (19:42 -0800)
iotjava/iotrmi/C++/IoTRMIUtil.hpp

index db437228bb0891215f2e8435f312d4efea0e0055..6b33b6199b58ce2a71d5d4dfaab5d6fc495ea284 100644 (file)
@@ -215,8 +215,8 @@ int IoTRMIUtil::getVarTypeSize(string type, void* paramObj) {
                int dataSize = getTypeSize("char");
                paramLen = (*(vector<char>*) paramObj).size() * dataSize;
        } else {
-               string error = "IoTRMICall: Unrecognizable type: " + type;
-               throw error;
+               cerr << "IoTRMIUtil: Unrecognizable type: " << type;
+               exit(-1);
        }
 
        return paramLen;
@@ -278,8 +278,8 @@ void* IoTRMIUtil::getParamObject(void* retObj, const char* type, char* paramByte
                // This is an array type, i.e. vector
                retObj = getArrayParamObject(retObj, type, paramBytes, len);
        } else {
-               string error = "IoTRMIUtil: Unrecognizable type: " + string(type);
-               throw error;
+               cerr << "IoTRMIUtil: Unrecognizable type: " << type;
+               exit(-1);
        }
 
        return retObj;
@@ -308,8 +308,8 @@ void* IoTRMIUtil::getArrayParamObject(void* retObj, const char* type, char* para
        } else if (strcmp(type, "String[]") == 0) {
                retObj = byteArrayToStringArray((vector<string>*) retObj, paramBytes, len);
        } else {
-               string error = "IoTRMIUtil: Unrecognizable type: " + string(type);
-               throw error;
+               cerr << "IoTRMIUtil: Unrecognizable type: " << type;
+               exit(-1);       
        }
 
        return retObj;
@@ -351,8 +351,8 @@ char* IoTRMIUtil::getObjectBytes(char* retObjBytes, void* obj, const char* type)
        // This is an array type, i.e. vector
                retObjBytes = getArrayObjectBytes(retObjBytes, obj, type);
        } else {
-               string error = "IoTRMIUtil: Unrecognizable type: " + string(type);
-               throw error;
+               cerr << "IoTRMIUtil: Unrecognizable type: " << type;
+               exit(-1);
        }
 
        return retObjBytes;
@@ -381,8 +381,8 @@ char* IoTRMIUtil::getArrayObjectBytes(char* retObjBytes, void* obj, const char*
        } else if (strcmp(type, "String[]") == 0) {
                retObjBytes = arrStringToByteArray(*((vector<string>*) obj), retObjBytes);
        } else {
-               string error = "IoTRMIUtil: Unrecognizable type: " + string(type);
-               throw error;
+               cerr << "IoTRMIUtil: Unrecognizable type: " << type;
+               exit(-1);
        }
 
        return retObjBytes;