Mistake of law
Mistake of law is a legal principle referring to one or more errors that were made by a person in understanding how the applicable law applied to their past activity that is under analysis by a court. In jurisdictions that use the term, it is differentiated from mistake of fact. There is a principle of law that "ignorance of the law is no excuse." In criminal cases, a mistake of law is not a recognized defense, though such a mistake may in very rare instances fall under the legal category of "exculpation". In criminal cases a mistake of fact is normally called simply, "mistake". General principles
Usually, there is in legal cases an irrebuttable presumption that people who are about to engage in an activity will comply with applicable law. As part of the rule of law, the law is assumed to be made available to everyone. The presumption of knowledge of applicable law generally will also apply in the situation of a recent change in the law with which a party in a legal case had no opportunity to become aware of it, e.g., the accused was out hunting in the wilderness and did not know that the law had changed to protect an endangered species. Some states make a distinction between a mistake as to the substance and effect of existing laws, and a mistake that the law creates a specific right to act in the particular way. For example, if A, the owner of a vehicle, takes it into a garage for repair and when returning to collect it, A finds that the vehicle has been left parked in the street. If he has an honest belief that he has the right as an owner to retake possession of the vehicle without paying the outstanding bill for the repairs, he will not be considered as stealing it despite the fact that the garage holds a lien over the vehicle and so has the better right to possession until the bill is paid. This form of the defense is difficult to prove because the defendant must be able to prove that he believed in something more positive than the law permitted the particular behavior. The belief must be that the law creates and vests a specific right to act in that way. Under the Theft Act 1968 and the Criminal Damage Act 1971, a defense will arise if the defendant honestly believes that he is entitled to act in the way he did and this will negate the relevant mens rea element (e.g., of dishonesty under §2 Theft Act 1968). In Chamberlain v Lindon 1998 Lindon demolished a wall to protect a right-of-way, despite allowing nine months to pass before acting, Lindon honestly believed that it was immediately necessary to protect his legal rights without having to resort to civil litigation. For the purposes of §5(2):

It is not necessary to decide whether Lindon’s action was justified as a matter of civil law. For the purpose of the criminal law, what matters is whether Lindon believed that his actions were reasonable, i.e., a subjective test. Since it was, the court was "on the facts found proved entitled to find that the Respondent had a lawful excuse for the purposes of section 5(2)(b) of the Criminal Damage Act 1971" and "on the facts found proved entitled to acquit [Lindon]" and "criminal proceedings were inappropriate. At worst a civil wrong had been committed, either nuisance by the appellant [Chamberlain] or trespass by the respondent [Lindon]. It should have been for the civil courts to decide which." Thus a lawful excuse may be acknowledged by a court to arise when a person honestly but mistakenly believes that the actions are necessary and reasonable. Mistake of non-governing law in the United States
One narrow area of exception occurs where a person makes a mistake of non-governing law. While the accused are not pardoned for failure to know what acts have been deemed criminal, they may not be held to know of non-criminal provisions that affect the status of things that might therefore be deemed criminal. For example, suppose Jennifer is married to Phillip, but decides to get a divorce in order to marry Ben. However, Jennifer mistakenly believes that the divorce was final when she submitted the paperwork required by the state and did not realize that she had to wait for a court to pronounce her divorced. In the interim, she marries Ben, and so is technically committing bigamy because she has married a second man before her divorce from the first was complete. Jennifer's mistake was not one of governing law (she did not mistakenly believe it was legal to be married to two people), but rather a mistake of non-governing law, which is akin to a mistake of fact. Depending on the jurisdiction in which the act took place, Jennifer may be allowed to raise the defense of mistake of law in such a scenario. See Long v. State, 44 Del. 262. References

External links
The Burden of Knowledge
Lambert VS California

Criminal defenses
Legal error