Section 8
Act done pursuant to judgment or order of Court
Nothing which is done in pursuance of, or which is warranted by, the judgment or order of a Court, if done whilst such judgment or order remains in force, is an offence, notwithstanding the Court may have no jurisdiction to pass such judgment or order, provided the person doing the act in good faith believes that the Court had such jurisdiction.
Act done by person justified or by mistake of fact believing himself justified by law 9.
Nothing is an offence which is done by a person who is justified by law, or who, by reason of a mistake of fact and not by reason of a mistake of law, in good faith believes himself to be justified by law, in doing it.
Illustration
A sees B commits what appears to A to be a qatl. A, to the best of his judgment, and in good faith, in the exercise of the power which the law gives to all persons for apprehending murderers in the act, seizes B in order to bring B before the authorities. A has committed no offence though it may turn out that B was acting in self-defence.