Section 465(2) in The Code of Criminal Procedure, 1973
(2)In determining whether any error, omission or irregularity in any proceeding under this Code, or any error, 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.