def convertCharToInt(value):
    """ Converts a string of length 1 (char) to an int. """
    try:
        value = int(value)
    except ValueError:
        error_template = ("convertCharToInt received '{0}' when num "
                          "expected")
        raise ValueError(error_template.format(value))
    if value > 9 or value < 0:
        error_template = "Value larger or smaller than 1 digit: {0}"
        raise ValueError(error_template.format(value))
    return value