* Create the exception object. Use java.io.InterrupedIOException
* Create the exception object. Use java.net.SocketTimeoutException
JSSL_throwSSLSocketException(JNIEnv *env, char *message){    const char *errStr;    PRErrorCode nativeErrcode;    char *msg = NULL;    int msgLen;    jclass excepClass;    jmethodID excepCons;    jobject excepObj;    jstring msgString;    jint result;    const char *classname=NULL;    /*     * get the error code and error string     */    nativeErrcode = PR_GetError();    errStr = JSS_strerror(nativeErrcode);    if( errStr == NULL ) {        errStr = "Unknown error";    }    /*     * construct the message     */    msgLen = strlen(message) + strlen(errStr) + 40;    msg = PR_Malloc(msgLen);    if( msg == NULL ) {        JSS_throw(env, OUT_OF_MEMORY_ERROR);        goto finish;    }    PR_snprintf(msg, msgLen, "%s: (%ld) %s", message, nativeErrcode, errStr);    /*     * turn the message into a Java string     */    msgString = (*env)->NewStringUTF(env, msg);    if( msgString == NULL ) goto finish;        /*         * Create the exception object. Use java.io.InterrupedIOException         * for timeouts, org.mozilla.jss.ssl.SSLSocketException for everything         * else.         * NOTE: When we stop supporting JDK <1.4, we should change         * InterruptedIOException to java.net.SocketTimeoutException.         */    if( nativeErrcode == PR_IO_TIMEOUT_ERROR ) {        excepClass = (*env)->FindClass(env, INTERRUPTED_IO_EXCEPTION);        PR_ASSERT(excepClass != NULL);        if( excepClass == NULL ) goto finish;            excepCons = (*env)->GetMethodID(env, excepClass, "<init>",            "(Ljava/lang/String;)V");        PR_ASSERT( excepCons != NULL );        if( excepCons == NULL ) goto finish;            excepObj = (*env)->NewObject(env, excepClass, excepCons, msgString);        PR_ASSERT(excepObj != NULL);        if( excepObj == NULL ) goto finish;    } else {        excepClass = (*env)->FindClass(env, SSLSOCKET_EXCEPTION);        PR_ASSERT(excepClass != NULL);        if( excepClass == NULL ) goto finish;            excepCons = (*env)->GetMethodID(env, excepClass, "<init>",            "(Ljava/lang/String;I)V");        PR_ASSERT( excepCons != NULL );        if( excepCons == NULL ) goto finish;            excepObj = (*env)->NewObject(env, excepClass, excepCons, msgString,            JSS_ConvertNativeErrcodeToJava(nativeErrcode));        PR_ASSERT(excepObj != NULL);        if( excepObj == NULL ) goto finish;    }    /*     * throw the exception     */    result = (*env)->Throw(env, excepObj);    PR_ASSERT(result == 0);finish:    if( msg != NULL ) {        PR_Free(msg);    }}