The validity of a contract is hindered by obtaining consent by an error of the parties. As already mentioned, an error can be of two types, an error of fact and an error of law. If consent to a contract is obtained on the basis of a bilateral error of fact, the contract is considered null and void, but if the error is due to a unilateral error of fact, the agreement is valid, unless there is an error as to the nature of the contract or the identity of the parties. If consent to a contract is obtained due to an error in Indian law, it is a valid contract, but if it is formed by both parties under foreign law, the contract is considered null and void.  Http://www.indiankanoon.org>doc. (last seen on 21. April 2020, 9:50 a.m.) Section 21 of the Act states that a contract cannot be characterized as voidable simply because one of the contracting parties erred in relation to a fact concerning the contract. A unilateral error therefore does not affect the validity of the contract and cannot constitute grounds for annulment of the contract in court. An error of fact is a valid defence, but an error of law is not. An error of law is not a valid defence, because every citizen is supposed to know and respect the laws of the land. Please note that to the extent that a defendant can plead an error of law (to deny the required element of intent of a law), this is true even if the error he made was unreasonable.
In this case, the person was prosecuted under the Immigration Act 1971 for exceeding the length of the leave. In that case, he may not invoke the plea of error of law. If a defendant had the necessary intention to commit an act but did not know that his act was unlawful because of an error of law, he usually has no valid defence. This is the basis of the popular maxim “ignorance of the law is no excuse”. Example: In general, a factual error generally refers to someone`s misunderstanding of the facts of a situation where the error leads the person to commit an illegal act.  There are some exceptions to the maxim “ignorantia facti excused”. First, no one can invoke ignorance of the facts when a responsible investigation would have produced the real facts. For example, if a person recouples because they honestly believe that their previous marriage was dissolved by a decree, but the decree was not granted, they cannot plead an error of fact and will be guilty of bigamy. Nor can an error of fact be accepted as an objection if the act is punishable by law.
For example, adulterated food cannot be sold on the basis of ignorance of the facts, as this is punishable under the Prevention of Food Adulteration Act 1954.  John Mcccurley, Is the mistake of fact `A defence to criminal accusation`, available at www.nolo.com (last seen April 20, 2020, 19:05) section 20 of the Act, if the material facts of the contract have been interpreted as errors, then it becomes questionable. It could also be considered unilateral and bilateral, that is, one of the parties and both parties. But Article 22 mentions that it is not open to challenge if a party has made an error of fact in the contract. In the event of a mutual error of fact, it becomes questionable. With the development of trade and industry, contract law was the first commercial law to emerge. To facilitate this, British India adopted and improved Britain`s treaty law. To refine it, British India received its Indian Contract Act, 1872. As a common law system, the principles were established by the British courts. With contract law as the common law and as a basis, specialized laws have developed over time in India. The contracting process includes offer, acceptance, consideration, but most importantly with the leaders` meeting. Both parties to a contract must be on the same page for it to be legitimate.
If this is not the case, the parties have erred about the aspect of the contract. There are various reasons and scenarios in which such an “error” would occur. The notion of error is mentioned in Chapter II of the Indian Contracts Act, which deals with voidable contracts and voidable agreements. Consent is defined in the law so that two people agree on the same thing. Whereas “free consent” would be if said consent is not influenced by any factor or caused by coercion, undue influence, fraud, misrepresentation or error. An error would therefore normally be an exception to free consent in a contract. It is also specifically mentioned in paragraphs 20, 21 and 22. No agreement if both parties are wrong about the actual facts — If both parties to an agreement have an error with respect to a fact essential to the agreement, the agreement is void. Explanation — An erroneous opinion as to the value of the thing that is the subject of the agreement is not considered an error of fact. “In factual terms”, this would mean that the parties to the case agreed, but that an object or fact misled them or that they were not aware of it. For example, A agrees to buy a Persian kitten from B. Later, it turns out that the kitten was dead at the time of the agreement talks, and neither side knew about it. The agreement is therefore null and void.
Effect of errors of law – A contract is not voidable because it was caused by an error in relation to a law applicable in India, but an error in relation to a law not applicable in India has the same effect as an error of fact. Figures A and B conclude a contract based on the misconception that a particular debt is prescribed by India; The contract is not cancellable. It is emphasized here that an error in relation to the law relating to India or outside India does not render it questionable.