The party to whom such assignment shall have been made may maintain an action on such bond, as assignee of the sheriff taking the same, in the same cases in which such action might be maintained by such sheriff, and shall recover damages for breaches of the condition of such bond as follows:
(1) If the prisoner escaping was confined by virtue of an execution or by virtue of an attachment for nonpayment of costs or of any sum of money ordered to be paid by a court or judge the measure of the plaintiff's damages shall be the amount directed to be levied by such execution or attachment, with interest thereon to the time of such recovery;(2) If the prisoner was confined by virtue of an order of arrest or writ of ne exeat, or upon a surrender by the prisoner's bail upon an order of arrest, made before or after judgment rendered against the prisoner, the plaintiff shall recover only the actual damages sustained by the plaintiff.