(ex, encoding=None)
return getUnicode(retVal, encoding=encoding)
Safe way how to get the proper exception represtation as a string
    (Note: errors to be avoided: 1) "%s" % Exception(u'\u0161') and 2) "%s" % str(Exception(u'\u0161'))
Safe way how to get the proper exception represtation as a string
    (Note: errors to be avoided: 1) "%s" % Exception(u'\u0161') and 2) "%s" % str(Exception(u'\u0161'))
Safe way how to get the proper exception represtation as a string ( Note : errors to be avoided : 1 ) %s % Exception ( u \ u0161 ) and 2 ) %s % str ( Exception ( u \ u0161 ))
def getSafeExString(ex, encoding=None):
    """
    Safe way how to get the proper exception represtation as a string
    (Note: errors to be avoided: 1) "%s" % Exception(u'\u0161') and 2) "%s" % str(Exception(u'\u0161'))
    """

    retVal = ex

    if getattr(ex, "message", None):
        retVal = ex.message
    elif getattr(ex, "msg", None):
        retVal = ex.msg

    return getUnicode(retVal, encoding=encoding)
def getSafeExString ( ex , encoding = None ) : retVal = ex if getattr ( ex , "message" , None ) : retVal = ex . message elif getattr ( ex , "msg" , None ) : retVal = ex . msg return getUnicode ( retVal , encoding = encoding )