def rethrow(self, msg, _type=InvalidResourceException):
        """
        Raises an exception with custom type and modified error message.
        Raised exception is based on current exc_info() and carries it's traceback

        @type msg: str
        @param msg: New error message

        @type _type: type
        @param _type: Reraised exception type

        @raises: Exception
        """
        exc_type, exc_value, exc_traceback = sys.exc_info()
        msg = msg + \
            "\nOriginal message: {0} {1}".format(exc_type.__name__, exc_value)
        raise _type(msg)
def rethrow ( self , msg , _type = InvalidResourceException ) : exc_type , exc_value , exc_traceback = sys . exc_info ( ) msg = msg + "\nOriginal message: {0} {1}" . format ( exc_type . __name__ , exc_value ) raise _type ( msg )
Raises an exception with custom type and modified error message.
        Raised exception is based on current exc_info() and carries it's traceback

        @type msg: str
        @param msg: New error message

        @type _type: type
        @param _type: Reraised exception type

        @raises: Exception