This is a writ of error to reverse a judgment of the court of common pleas. The action was replevin for goods, originally commenced before a justice of the peace, carried by appeal to the common pleas, and there judgment was rendered for the original defendant, for a return of the goods, with damages assessed at two dollars, and costs fifty six dollars. Upon this judgment the original plaintiff brings error; and the first error assigned is, that the justice had no original jurisdiction of the writ, and of course the court of common pleas had no appellate jurisdiction, and therefore the judgment is erroneous.
It may seem, • on the first suggestion, that the law would depart from its usual rules of action in allowing a party to take advantage of his own wrong, and reverse a judgment for an error which he himself has committed in bringing his suit in a court having no jurisdiction. But without stopping to consider how far this consideration would apply to other species of error, we think that whatever other defects may be waived, consent cannot give jurisdiction where the law has not given it; and that a writ of error will lie in this case, at the suit of the party who commenced the action, to reverse a judgment against him, if the justice had no original jurisdiction. 2 Saund. 47, note (8.) Carpron v. Van Noorden, 2 Cranch, 126. Striker v. Mott, 6 Wend. 465. Yelv. (Amer. ed.) 107, note.
Upon that part of the case, the court are of opinion that a justice of the peace has no jurisdiction in replevin, except in cases of beasts distrained or impounded. Rev. Sts. c. 113, § 17 *591Such were the provisions, and such, we understand, was the uniform practice under the former statutes. Sts. 1788, c. 65, and 1789, c. 26. A very special provision being made, authorizing a justice to entertain jurisdiction in an action of replevin for beasts impounded or distrained, the maxim applies, expressio unius exclusio est alterius; giving an express jurisdiction in a particular case implies that it is not given generally. It was con tended that the justice had jurisdiction in replevin, under his general power to take cognizance of civil actions. Rev. Sts. c. 85, § 1. But the language limits such suits to cases where debt or damage is demanded, and is not applicable to a case of replevin, where the principal subject of controversy is the right to a specific chattel. We are not aware that there is any decided case in our own reports, on the subject. Probably the question has not been before brought up for adjudication. Such however is the decision in Maine, under the laws of Massachusetts, and under those of Maine, until altered, and the jurisdiction extended, by a recent statute. St. 1829, c. 443. Small v. Swain, 1 Greenl. 133. Ridlon v. Emery, 6 Greenl. 261.
The court are therefore of opinion that the judgment, so far as it was erroneous, must be reversed. But so far as that judgment awarded costs for the defendant, it was not erroneous It was formerly considered, that where the ground of decision was, that the court had no jurisdiction, no judgment would be entered, and of course no costs awarded; and there were several conflicting decisions. But the subject was fully considered and decided in a recent case, and it was held, upon the very broad words of the statute giving costs to the prevailing party in all civil actions, (Rev. Sts. c. 121, § 1,) that costs should be allowed, where the decision was, that the court had no jurisdiction. Cary v. Daniels, 5 Met. 236. That decision must govern the present case. The court are called on, in such case, to decide, and must in due course of judicial proceeding decide, whether they have jurisdic'ion to hear the parties on the merits. This is a proceeding attended with expense; the party successfully resisting the juris» diction is the prevailing party; and we are of opinion, that with in the spirit, if not the terms, of the statute, he is entitled to costs
*592Where a judgment consists of parts which are distinct, it may be affirmed in part, and reversed in part. Frederick v. Lookup, 4 Bur. 2018. Cummings v. Pruden, 11 Mass. 206. Smith v. Jansen, 8 Johns. 111. Applying that rule to the present case, we are of opinion, and do adjudge, that so much of the said judgment as awarded to the defendant a return of the goods replevied, and damages for the taking, be reversed; and that so much of the said judgment as awarded costs for the defendant be affirmed.
Bishop, for the plaintiff in error.
D. N. Deiuey, for the defendant in error.