This is a petition for a writ of habeas corpus. The record shows that complaint in a criminal proceeding was filed against Kelley in a district court having jurisdiction of the parties. The charge was that he, being *199of sufficient ability, did unreasonably neglect and refuse to provide for the support and maintenance of his wife and two minor children. On February 1, 1935, he was found guilty and was ordered to pay $25 forthwith and thereafter a specified sum weekly. He was committed for contempt of court for failure to pay $25 forthwith and was sentenced to be confined in the house of correction for one month.
The case was heard by a single justice on the petition, mittimus and record of the District Court. An order was made that the petition be dismissed on the ground that the remedy was by writ of error and not by habeas corpus. The correctness of that ruling was reported for the consideration of this court.
It is conceded rightly in behalf of the Commonwealth that commitment for contempt may lawfully be made only “to any jail in the Commonwealth” and that sentence for contempt to a house of correction is invalid. Hurley v. Commonwealth, 188 Mass. 443, 448. G. L. (Ter. Ed.) c. 220, § 14.
The offence with which Kelley was charged was made a crime by G. L. (Ter. Ed.) c. 273, §§ 1-4. The District Court had jurisdiction of the crime and of the parties on the face of the record. Commonwealth v. Booth, 266 Mass. 80, 84. It is provided by G. L. (Ter. Ed.) c. 273, § 4, that violation of an order of this nature made by a court “may be punished as for a contempt by the court before which the case is then pending.” This statute is constitutional. Therefore where, as here, the court had jurisdiction of the proceedings and of the parties, the remedy for any harmful irregularity is by writ of error and not by habeas corpus. Connors, petitioner, 254 Mass. 103. “The general rule is that where the court has jurisdiction, and errs merely in regard to the punishment, relief will not be granted by habeas corpus, but that the remedy is by a writ of error, in which the mistake can be corrected and such sentence pronounced as should have been imposed.” Bishop, petitioner, 172 Mass. 35, 36. Sellers’s Case, 186 Mass. 301, 303. Commonwealth v. McNary, 246 Mass. 46, 48. Home Investment Co. v. Iovieno, 246 Mass. 346, 348. A writ of habeas *200corpus cannot be- invoked to perform the purposes of a writ of error. Frank v. Mangum, 237 U. S. 309, 326. Craig v. Hecht, 263 U. S. 255, 277. Habeas corpus is not available to one who “has been convicted or is in execution upon legal process, civil or criminal.” G. L. (Ter. Ed.) c. 248, § 1. It is provided by G. L. (Ter. Ed.) c. 250, § 9, that “A judgment in a criminal case may be re-examined and reversed or affirmed upon a writ of error for any error in law or in fact.” The practice thus established by adjudication and statute renders inapplicable cases like Ex parte Lange, 18 Wall. 163. See In re Belt, 159 U. S. 95.
The purpose of the statute creating the crime with which Kelley was charged was to enforce the natural obligation of a husband and father to support his wife and children. To that end the General Court incorporated the provisions as to contempt into the criminal proceeding. The two are interwoven and in a case like the present constitute one continuous prosecution. The contempt in the case at bar was committed in the presence of the court by failure to obey an order for instant action. The court had jurisdiction to deal with that contempt without further complaint. Hurley v. Commonwealth, 188 Mass. 443, 446. Blankenburg v. Commonwealth, 272 Mass. 25, 35. The adjudication of contempt and commitment therefor by the judge of the District Court was a judgment in a criminal case and Kelley was therefore convicted and in execution upon criminal process. G. L. (Ter. Ed.) c. 250, § 9; c. 248, § 1. The order of the single justice was right.
The petition is to stand dismissed.