The Code of Criminal Procedure, 1973 (CrPc)
465. Finding or sentence when reversible by reason of error, omission or irregularity.
(1) Subject to the provisions hereinbefore contained, on finding sentence or order passed by a court of competent jurisdiction shall be reversed or altered by a court of appeal, confirmation or revision on account of any error, omission or irregularity in the complaint, summons, warrant, proclamation, order, judgment or other proceedings before or during trial or in any inquiry or other proceedings under this Code, or any error, or irregularity in any sanction for the prosecution unless in the opinion of that court, a failure of justice has in fact been occasioned thereby.
(2) In determining whether any error, omission or irregularity in any proceeding under this Code, or any error, or irregularity in any sanction for the prosecution has occasioned a failure of justice, the court shall have regard to the fact whether the objection could and should have been raised at an earlier stage in the proceedings.