def extract_value(error):
    """
    Returns the value in the error message (as a string)

    If error is a ValueError, then the error is guaranteed
    to be after the final colon.

    Parameter error: The error object
    Precondition: error is a ValueError
    """
    assert isinstance(error,ValueError), repr(error)+' is not a ValueError'
    msg = error.args[0]
    pos = msg.rfind(':')
    result = msg[pos+1:]
    return result.strip()