(after stating the case), delivered the opinion of the court.
Section 3286 off the Code provides that when in an action of assumpsit for money (except where the process is served by publication), an affidavit is filed with the declaration, stating that the amount claimed is justly due, and the time from which interest is claimed, no plea in bar shall be received, either at rules or in court, unless accompanied by an affidavit in support thereof. And then it is further enacted that “ if such plea and affidavit be not filed by the defendant, there ' shall be no inquiry of damages, but judgment shall be for the *510plaintiff for the amount claimed in the affidavit filed with the declaration.”
These provisions relative to the action of assumpsit were, for • the first time, incorporated into the statute law of the state upon the adoption of the new Code. Their evident purpose is to prevent delay, and, with that object in view, to simplify and shorten the proceedings. It wi.ll be observed that the provision is express that no plea in bar shall be received, unless accompanied by an affidavit; so that without the requisite affidavit, such a plea is, in leg’al effect, a nullity. There can be no doubt, therefore, that the motion to strike out the plea in the present case was rightly granted, nor that the case stood before the motion was granted, in contemplation of the statute, as though no plea had been tendered at rules.
The question, then, is, not whether the circuit court erred in refusing to remand the case to rules, or to allow a plea and affidavit to be filed in court, but whether in giving final judgment, as it did, it exceeded its jurisdiction. In other words, is the judgment void? Tor unless it is, the case is not a proper one for a prohibition.
The office of the writ of prohibition, we need hardly say, is not the correction of mere errors. The writ lies only to restrain an inferior court from acting in a matter of which it has no jurisdiction, or from exceeding the bounds of its jurisdiction. Hence, if the inferior court has jurisdiction of the subject-matter of the controversy, and the parties are before it, or have had notice and an opportunity to be heard, a mistaken exercise of that j urisdiction does not render its judgment void, or justify a resort to the extraordinary remedy by prohibition. Or, as it has been tersely expressed, the writ of prohibition does not lie to prevent a subordinate court from deciding erroneously, or from enforcing an erroneous judgment, in a case in which it has a right to adjudicate. High, Extr. Rem., sec. 772; Hogan v. Guigon, 29 Gratt. 705; Nelms v. Vaughan, 84 Va. 696 ; State v. Smith, 104 Mo. 419.
In the present case the circuit court had jurisdiction, both of *511the subject-matter and of the parties. The defendants appeared to the action, and pleaded, though their plea, as we have seen, was in effect a nullity. They, however, had their day in court, and they were not arbitrarily put out of court, and denied an opportunity to make defence, as was the defendant in the celebrated McVeigh cases, cited and relied on by counsel, viz.: McVeigh v. United States, 11 Wall. 259; Windsor v. McVeigh, 93 U. S. 274; Underwood v. McVeigh, 23 Gratt. 409.
IXor had they an absolute right under the statute to plead a second time. Their first plea, moreover, being a nullity, the effect was the same as if they had not pleaded at all, in which case it would have been the duty of the clerk to enter a j udgment at rules for the plaintiff, since the statute is imperative that in such a case there shall be no inquiry of damages, but judgment shall be for the plaintiff'.
In short, whatever may be said as to the correctness of the judgment — and we do not mean to intimate that it is erroneous — it is not void, and that is decisive of the case. If the defendants have lost a good defence by neglecting to seasonably assert it in the manner prescribed by the statute, they cannot now obtain the benefit of it, or be relieved from the consequences of their own neglect, by a writ of prohibition.
Pauntlekoy, J., dissented.
Petition dismissed.