FRICK, C. J.
The plaintiff commenced this action against the defendant to recover upon a promissory note. The defendant answered the complaint, admitting the indebtedness evidenced by said note, and set up a counterclaim, in which he averred that the plaintiff was indebted to him in a sum in excess of the amount claimed by the plaintiff. The plaintiff interposed a demurrer to the counterclaim: (1) That the facts stated are insufficient; (2) that the matter set forth as a counterclaim “is not a proper subject of counterclaim in this action, for the same is in the nature of an action for an accounting and therefore equitable”; and (3) that the counterclaim is ambiguous, uncertain, etc. The court sustained the demurrer (but upon what ground the record does not disclose) and entered judgment for the plaintiff for the amount of the promissory note. Defendant appeals.
1 Before proceeding to a consideration of the court’s ruling on the demurrer respecting the sufficiency of the *85counterclaim, etc., we are required to determine a motion interposed by tbe plaintiff to dismiss the appeal.
‘ ‘ The undertaking on appeal must be in writing, and must that no undertaking on appeal has been executed and filed as required by Comp. Laws 1907, section 3306. That section reads:
“The undertaking on appeal must be in writing, and must be executed on the part of the appellant, by at least two sureties, to the effect that the appellant will pay all damages and costs which may be awarded against him on the appeal, or on a dismissal thereof, not exceeding $300; or that sum must be deposited with the clerk with whom the judgment or order was entered, to abide the event of the appeal.”
Section 3307 also provides for an undertaking to stay execution in case the appellant desires to prevent the enforcement of the judgment pending the appeal. It is not necessary, however, to quote from or to refer specially to that section.
The defendant in this ease caused to be executed, and in proper time filed, an undertaking with proper sureties as required by our statute. The plaintiff, however, insists that the undertaking executed and filed is in fact an undertaking to stay execution under section 3307, and not an undertaking on appeal which is required by section 3306, supra. While it is true that the terms of the undertaking filed in this case are broad enough to operate as a stay of execution, yet, in our judgment, its terms are also broad enough to constitute a sufficient undertaking on appeal. There is nothing in the statute which prohibits an appellant to cover the provisions contained in both sections aforesaid in one undertaking, if he so elects; and, if he in fact causes to be executed and filed an undertaking that is sufficient to comply with the requirements of section 3306, his appeal ought not to fail simply because he has included in the undertaking more than is made necessary by that section. In the undertaking that is assailed by the plaintiff the sureties bound themselves as follows:
‘ ‘ That if the judgment appealed from, or any part thereof, be affirmed or the appeal be dismissed, the appellant will pay the amount directed to be paid by the judgment or order, or *86the part of such amount as to which the judgment or order is affirmed if affirmed only in part, and all damages and costs which may be awarded against the appellant upon the appeal, and that if the appellant does not make such payment within thirty (30) days after the filing of the remittitur of the Supreme Court in the court from which this appeal is taken, then in that event, judgment may be entered on motion of the respondent in his favor against the sureties herein for such amount together with the interest that may be due thereon, and the damages and costs which may be awarded against the appellant upon the appeal.”
Now, all that is required by section 3306 is that the appellant cause to be executed an undertaking “to the effect that the appellant will pay all damages and costs which may be awarded against him on the appeal, or on a dismissal thereof, not exceeding $300.” It is true that in the undertaking in question the amount is in excess of $300; but surely that is no reason why the sureties are not bound, and hence affords no cause for complaint on the part of the plaintiff.
Plaintiff, in support of his motion to dismiss the appeal for the reason stated, has cited and relies on Hill v. Finnigan, 54 Cal. 493, Duffy v. Greenebaum, 72 Cal. 157, 12 Pac. 74, 13 Pac. 323, and Zane v. De Onativia, 135 Cal. 440, 67 Pac. 685, in which cases, he contends, the Supreme Court of California, under a statute like ours, has sustained his contention. We have examined those cases, and in the case of Duffy v. Greenebaum, supra, the Supreme Court of California, by a divided court, apparently held that if an appellant files an undertaking which covers both sections, such an undertaking is insufficient as an undertaking on appeal. We say the court has apparently so held for the reason that the terms of the undertaking there in question are not set forth, and from what is said in the opinion, and especially in the dissenting opinion, we conclude that the holding of the court is to that effect. As before stated, however, and such is clearly the view expressed in the dissenting opinion filed in that case, if an undertaking executed and filed is sufficient to meet the requirements of section 3306, the appeal should not be dismissed. The other California cases cited upon this point add nothing to what *87has been said. We only desire to add here that while it is our duty to protect and enforce the rights of all litigants, yet if an appellant has, in substance and effect, complied with the provisions of section 3306, and has thus protected the rights of his adversary, as contemplated by that section, the appeal should be upheld. The right of appeal is a constitutional one in this state and should not be frittered away by adhering too strictly to the letter without due regard for the spirit and purpose of the statute. In our opinion defendant has complied with both the purpose and the spirit of the statute, and the rights of the plaintiff being protected and enforceable in case the appeal were for any reason dismissed, the motion to dismiss the appeal should be, and it accordingly is, denied.
2 We thus proceed to determine the merits of plaintiff’s demurrer to the counterclaim. The defendant in Ms counterclaim, in substance and effect, averred that on a day named the defendant, the plaintiff and others executed a certain deed of conveyance for certain water rights belonging to the defendant, the plaintiff and others; that the purchase price to be paid for said water rights by the grantees in such deed was the sum of $10,000; that after said deed had been executed by the grantors the same was given into the possession of the plaintiff, and he delivered the same to the grantee, and that he received the full purchase price of said water rights from'the grantee in said deed, and has kept and applied the same to his own use; that the defendant was the owner of one-half of said water rights, and that one-half of the purchase price thereof as aforesaid is due and owing to him from said plaintiff. The defendant prayed judgment for one-half of said purchase price, to wit, the sum of $5,000, less the amount found due to the plaintiff on said promissory note.
There can be no doubt that the counterclaim states a cause of action against the plaintiff. Plaintiff’s counsel, however, insists that the claim set forth by the defendant in the counterclaim “is not a proper subject of counterclaim” because, as he contends, it arises out of a partnership transaction. It is elementary that a demurrer, whether general or special,' can reach no defects save such as appear upon the face of the *88pleading to which it is directed. The question, therefore, is, In what way does it appear from defendant’s answer that the counterclaim therein set forth arises out of a partnership transaction? The basis for such a contention is that the defendant avers that the water rights which were conveyed by the .deed mentioned in the counterclaim belonged to himself, to the plaintiff, and to “others.” This does not necessarily imply that the owners of the water rights were “partners” as that term is generally understood. Much less does it imply that the claim arises out of unsettled partnership accounts which existed at the time this action was commenced as between the plaintiff, the defendant, and the “others.” Nor does it necessarily follow that the other owners of the water rights which were sold are necessary parties to this action, or that they had any present interest whatever when the action was commenced in the $5,000 claimed by the defendant as one-half of the purchase price of said water rights. Indeed, the defendant alleged that he was the owner of one-half of the water rights conveyed as aforesaid, and that by reason of such ownership he was entitled to one-half of the purchase price amounting to $5,000, which was retained by the plaintiff and converted to his own use. Those facts, however inarti-ficially pleaded — and it must be conceded that the pleading is inartificially drawn — are admitted to be true by the demurrer, and, if true, the defendant’s claim should prevail. For aught that is made to appear the plaintiff may have paid the shares of the purchase price belonging to the “others” named in the counterclaim, and hence, according to defendant’s allegations, no one, except the defendant, has a right to the $5,000, which is one-half of the purchase price of the water rights aforesaid. Whatever rights the plaintiff alone may have as against that part of the defendant’s claim certainly may be settled in this action. Why, then, should the defendant not be permitted to set up his claim in this action ? If there is any legal reason why such may not be done, it certainly does not appear from the pleadings as they now stand.
Plaintiff’s counsel has, however, cited cases in which he contends it is held that unsettled partnership accounts are not a proper subject of counterclaim in an action at law. The *89eases specially relied on are Wood v. Brush, 72 Cal. 224, 13 Pac. 627, Haskell v. Moore, 29 Cal. 439, Hook v. White, 36 Cal. 299, Lane v. Turner, 114 Cal. 396, 46 Pac. 290, and Roberts v. Donovan, 70 Cal. 108, 9 Pac. 180, 11 Pac. 599. Neither Hook v. White nor Roberts v. Donovan have any bearing upon the question. In Wood v. Brush the Supreme Court of California, in passing upon the question, in 72 Cal. at page 226, 13 Pac. at page 628, said:
'■ ‘ The counterclaim set out in the supplemental pleading is clearly due, if at all, as a partnership account against sundry persons besides plaintiff, and, until an accounting is had and a balance struck, is not the subject-matter for an action at law. It is not, therefore, a counterclaim ‘ existing in favor of a defendant and against a plaintiff, between whom a several judgment might be had in the action within the meaning of section 438 of the Code of Civil Procedure.’ ”
To the same effect are the decisions in Lane v. Turner, supra, and Haskell v. Moore, supra.
As we have pointed out, however, there is nothing contained in the defendant’s counterclaim which brings it within the rulings of those eases. It may therefore be conceded that the decisions by the Supreme Court of California are right, but, notwithstanding that, have no controlling influence here.
3 The defendant’s counsel, however, also insists that, in view that a cause of action is stated in the counterclaim, and that plaintiff’s demurrer should have been overruled, and that plaintiff, nevertheless, stood upon his demurrer without interposing any defense to the counterclaim, therefore we should enter or direct a judgment to be entered in favor of the defendant upon the counterclaim for the amount claimed therein, less the amount of plaintiff’s promissory note in case that we overrule the demurrer. In support of his contention defendant’s counsel cites Gammon v. Bunnell, 22 Utah, 421, 64 Pac. 958. In that case, in an action for specific performance of a contract, a demurrer was interposed to the complaint, which was sustained by the trial court. The plaintiff elected to stand on his complaint, and judgment was entered against him, dismissing the same, and he appealed to this court. This court held that the complaint stated a cause of action, and that the demurrer should have been overruled, *90and further held that, in view that the defendant interposed no defense to the complaint, except the demurrer by which the facts stated in the complaint were admitted, therefore the plaintiff was entitled to judgment for specific performance as prayed for in the complaint. On rehearing* however, the opinion was modified so as to permit the defendant to interpose a defense to the complaint, and the cause was remanded to the district court for that purpose. The decision in that case, so far as we are aware, has never been followed, nor has it been overruled, not directly at least. The question, therefore, is, Should the original opinion in that case be followed in this one? We think not. It should not be overlooked that in this case the principal ground of demurrer, and the one argued in this court, was that the matter set up in defendant’s answer as a cause of action against the plaintiff was not a proper subject of counterclaim. While it is true that the facts pleaded in the counterclaim were admitted by the demurrer, yet it is also true that the ground of demurrer was in the nature of abatement merely. That is, if the trial court’s ruling on the demurrer were affirmed by this court, the facts .pleaded in the counterclaim as a cause of action against the plaintiff would not be adjudicated, but the cause of action would continue to exist in favor of the defendant and against the plaintiff as if no demurrer had been interposed. All that would have been adjudicated, therefore, was that the cause of action pleaded in the counterclaim was not pleadable against the plaintiff in this action, and not that the defendant had not stated a cause of action. While it is true that in this jurisdiction matters in abatement and matters in bar must be set forth in the same answer, yet it is also true that matters in abatement, where the defects appear on the face of a pleading, may be reached by special demurrer as was done in this case by plaintiff’s counsel. When, therefore, a special demurrer is interposed which, if sustained, would merely abate an action or cause of action, we do not think that if such a demurrer is overruled the party against whose pleading the same was directed should be entitled,to judgment on the merits, even under the broad rule first announced in Gammon v. Bunnell, supra. Nop do we think that in case a *91demurrer is sustained by the trial court, which is ultimately held bad by this court on appeal, a judgment should be entered upon the merits against the party interposing the demurrer, except it is clearly made to appear that the demurrer was frivolous or that no defense could, in any event, be made to the cause of action against which the demurrer was directed. It is elementary, in this jurisdiction at least, that either party may interpose a demurrer to invoke the judgment of the trial court respecting the sufficiency of any pleading, and that if the pleading is found sufficient, the demurrant may, on proper terms, and within a reasonable time, be permitted to interpose his defense upon the facts, if he have any. Why should a party be deprived of his right to interpose a defense upon the facts, so long as, in the opinion of his attorney, no cause of action is stated in the pleading demurred to? And why may not a party, if done in good faith, in this court on appeal test the sufficiency of a pleading by demurrer, as well as in the trial court, without being deprived of the right to interpose a defense as to the facts if he have one? While courts should not permit litigants to interpose frivolous demurrers, or merely for delay, yet upon the other hand, they should not deprive either party of the right to defend upon the merits merely because he, in good faith, may have misjudged the law upon a given point by interposing a demurrer which the court holds to be not well taken. We are satisfied that the demurrer was interposed in good faith in this case, and that the plaintiff should be given an opportunity to present his defense to the counterclaim if he have any.
We are of the opinion that the district court erred in sustaining plaintiff’s demurrer and in entering judgment for him. The judgment is therefore reversed, and the cause is remanded to the district court of Salt Lake county, with directions to overrule the demurrer and to permit either or both parties to file additional pleadings and to proceed with the cause in accordance with the foregoing opinion. Defendant to recover costs on appeal.
McCARTY, CORFMAN, THURMAN, and GIDEON, JJ., concur.