A civil prisoner, committed to jail upon process for contempt, or committed for misconduct in a case prescribed by law, must be actually confined and detained within the jail, until he is discharged by due course of law, or is removed to another jail or place of confinement, in a case prescribed by law. A sheriff or keeper of a jail, who suffers such a prisoner to go or be at large out of his jail; except by virtue of a writ of habeas corpus, or by the special direction of the court committing him, or in a case specially prescribed by law; is liable to the party aggrieved, for his damages sustained thereby, and is guilty of a misdemeanor. If the commitment was for the nonpayment of a sum of money, the amount thereof, with interest, is the measure of damages.
N.Y. Correct.Law § 514