In capital cases (say, murder or adultery), ignorance of the law is a valid defense. A Jewish court requires two witnesses to give evidence that the defendant was taught ahead of time that his action carries the death penalty. Without that warning, he cannot be convicted.
Are there any other cases in which ignorance of the law is a valid excuse? Sources?