The origin of the idiom 'the exception proves the rule' appears to come from Roman law, whereby, if the law-body gives an allowing statement that does not directly outline a law; but instead implies its existence due to phrasing itself as an exception... then that is sufficient to prove the existence of the rule to those who must follow the law-body.
"Fowler gives the following example of the original meaning:Special leave is given for men to be out of barracks tonight till 11.00 p.m.; "The exception proves the rule" means that this special leave implies a rule requiring men, except when an exception is made, to be in earlier. The value of this in interpreting statutes is plain." - Wiki