Hey
It is one of the most important sections.
Section 21 in The Indian Contract Act, 1872
21. Effect of mistakes as to law.—A contract is not voidable because it was caused by a mistake as to any law in force in [India]; but a mistake as to a law not in force in [India] has the same effect as a mistake of fact. —A contract is not voidable because it was caused by a mistake as to any law in force in[India]; but a mistake as to a law not in force in 1[India] has the same effect as a mistake of fact."
Illustration
A and B make a contract grounded on the erroneous belief that a particular debt is barred by the Indian Law of Limitation; the contract is not voidable.
In Cooper v Phibbs the plaintiff took a lease of certain fishery rights, and afterwards sought to avoid the contract on the ground of mistake, in that he did not know that the fishery belonged to himself, and ignorantly thought that it belonged to himself, and ignorantly thought that it belonged to the defendant. The defendant contended that this being a mistake of law, the plaintiff could not succeed. But, the Court held that ignorance of a private right was on a par with ignorance of fact and therefore would be excusable in law.
I hope this helps!
Regards