508. If any Magistrate not empowered by law to do any of the following things, namely:—
509. If any Magistrate, not being empowered by law in this behalf, does any of the following things, namely:—
510. No finding, sentence or order of any Criminal Court shall be set aside merely on the ground that the inquiry, trial or other proceedings in the course of which it was arrived at or passed, took place in a wrong sessions division, district, sub-division or other local area, unless it appears that such error has in fact occasioned a failure of justice.
511. (1) If any Court before which a confession or other statement of an accused person recorded, or purporting to be recorded under section 183 or section 316, is tendered, or has been received, in evidence finds that any of the provisions of either of such sections have not been complied with by the Magistrate recording the statement, it may, notwithstanding anything contained in section 94 of the Bharatiya Sakshya Adiniyam 2023, take evidence in regard to such non-compliance, and may, if satisfied that such non-compliance has not injured the accused in his defence on the merits and that he duly made the statement recorded, admit such statement.
(2) The provisions of this section apply to Courts of appeal, reference and revision.
512. (1) No finding, sentence or order by a Court of competent jurisdiction shall be deemed invalid merely on the ground that no charge was framed or on the ground of any error, omission or irregularity in the charge including any misjoinder of charges, unless, in the opinion of the Court of appeal, confirmation or revision, a failure of justice has in fact been occasioned thereby.
(2) If the Court of appeal, confirmation or revision, is of opinion that a failure of justice has in fact been occasioned, it may,—
(a) in the case of an omission to frame a charge, order that a charge be framed, and that the trial be recommended from the point immediately after the framing of the charge;
(b) in the case of an error, omission or irregularity in the charge, direct a new trial to be had upon a charge framed in whatever manner it thinks fit:
Provided that if the Court is of opinion that the facts of the case are such that no valid charge could be preferred against the accused in respect of the facts proved, it shall quash the conviction.
513. (1) Subject to the provisions hereinbefore contained, no finding, sentence or order passed by a Court of competent jurisdiction shall be reversed or altered by a Court of appeal, confirmation of 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 Sanhita, 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 Sanhita, 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.
514. No attachment made under this Sanhita shall be deemed unlawful, nor shall any person making the same be deemed a trespasser, on account of any defect or want of form in the summons, conviction, writ of attachment or other proceedings relating thereto.