Donatism was the error taught by Donatus, bishop of Casae Nigrae, that the effectiveness of the sacraments depends on the moral character of the minister. In other words, if a minister who was involved in a serious enough sin were to baptize a person, that baptism would be considered invalid.
Please see Heresies for more information.