Whenever any action of replevin shall be brought against an officer who has taken or attached goods and chattels at the suit of a creditor, the creditor shall have the right to assume the defense of the suit upon indemnifying the officer against damages and costs therein, and the money recovered by way of damages by the officer shall be deemed to be recovered to the use of the attaching creditor, and when received shall be paid over to the creditor.
R.I. Gen. Laws § 34-21-13