The district court of appeal granted a writ ofcertiorari to review the action of the superior court in granting a motion for a new trial in a certain action entitledEwell v. McKenzie and Stow, in the superior court of the state of California in and for the county of Alameda. The contention of petitioner was that the judgment had been granted upon the pleadings; that, therefore, there were no questions of fact to review on a new trial; and that consequently a motion for a new trial would not lie.
The learned district court of appeal being satisfied that the judgment was rendered in response to a motion for judgment on the pleadings, held, upon the authority of Gray v. Cotton,174 Cal. 256, [162 P. 1019], that the attempt to obtain a new trial was unauthorized and that the court was without jurisdiction to grant it. On rehearing, the court reached the same conclusion as before and set aside the order granting a new trial as one made without jurisdiction by the court below. The court of appeal said, in part:
"This matter was a hearing upon a motion for judgment on the pleadings purely and simply. It was presented in that form, as the record now shows, by the concurrence and consent of counsel for both sides in open court at the time the motion was granted. The judgment in the case shows it was a judgment based upon a motion for such judgment on the pleadings. No issue of fact was tried, and no issue of fact could be re-examined after such judgment. The only remedy which the party had for whatever error the court committed in granting a judgment upon the pleadings was by an appeal. The former opinion which the court rendered in this matter will stand as the opinion of the court."
Upon petition the matter was transferred to this court.
It is contended that both by reason of the stipulation of plaintiff's counsel in the trial of the case in the superior court and because of the contents of the judgment itself, this court is bound to accept the theory that the judgment was one given on the pleadings and involving no disputed issues of fact.
Upon the record now before us it is shown that the course of events was substantially as follows: Action was commenced in the superior court, plaintiff's cause resting largely upon the alleged obligations arising from a certain written contract attached to the complaint as an exhibit. Demurrer to the complaint was overruled, an answer was filed, and the cause *Page 142 being at issue was brought on for trial before a judge other than the one who had ruled upon the demurrer. A trial by jury was waived; counsel for the respective parties made their addresses outlining their respective theories and the proofs which they intended to offer in support thereof; a witness for plaintiff was called and sworn and his testimony was sought to be introduced by plaintiff. Defendants' counsel objected to the introduction of any evidence on behalf of plaintiff on the ground that the complaint failed to state facts sufficient to constitute a cause of action, in that the contract attached to the complaint as an exhibit was for an indefinite term. The objection was sustained by the learned judge of the superior court upon the ground that by the terms of the contract attached as an exhibit to the complaint an action on that agreement was not maintainable. Thereafter, defendants moved to dismiss their cross-complaint and the motion was granted. Then they moved for judgment on the pleadings on the ground that the complaint did not state facts sufficient to constitute a cause of action. This motion was granted. The judge by affidavit has declared that in granting the motion last referred to, he did not take into consideration the allegations of the complaint at all, but only regarded the contract marked "Exhibit A." Subsequently, on motion for new trial the court, convinced that the conclusion regarding the insufficiency of the complaint had been erroneous, granted the motion, and this is the order which, it is contended, was beyond the jurisdiction of the superior court to make.
At the trial, after the court had expressed a conviction that the complaint did not state facts sufficient to constitute a cause of action, counsel for plaintiff said: "Well, if your Honor has that view of it, there is no use going any further; if the complaint does not state a cause of action, of course, then, the easiest way to test that is by the defendant making a motion for judgment on the pleadings, and, if that is granted, then I can settle that bill of exceptions very quickly." This was followed by dismissal of the cross-complaint at request of counsel for defendants and the making and granting of the motion for judgment on the pleadings.
At the oral argument on this proceeding the contention was made, in effect, that the suggestion by counsel for plaintiff in the court below amounted to a stipulation that judgment on the pleadings be entered. As counsel said in argument before *Page 143 this court: "I could not have made the motion if it had not been by consent." We do not construe the remarks of counsel for plaintiff in the court below as amounting to consent that a judgment on the pleadings should be entered. Indeed, he stoutly asserted at all times that his pleading was good. His suggestion to his opponent waived nothing. It was merely a statement of that which, in contemplation of the court's view of the law, counsel for plaintiff believed to be a speedy method of getting ready for an appeal. Petitioner's counsel, while conceding that the issue of law had been duly decided when the court passed upon his demurrer to the complaint, says that his motion for judgment on the pleadings was equivalent to a new demurrer, and that the suggestion from his opponent amounted to a consent to the withdrawing of the answer and a stipulation for a decision solely upon the sufficiency of the complaint to aver facts amounting to a cause of action. We cannot see that the language and conduct of plaintiff's counsel in the trial court created such a stipulation, and even if they could be so construed, it does not appear that as matter of record the answer was withdrawn. The situation, therefore, is this: Upon trial of issues under pleadings which had passed demurrer, proffered testimony was rejected upon the ground that it could not be relevant under the complaint believed by the court to be faulty; plaintiff stood upon his pleading; and the court gave judgment against him. Respondent takes the position that in essence this was a judgment of nonsuit, and with this view we agree. In the case of Green v. Duvergey, 146 Cal. 379, [80 P. 234], the court refused to permit the introduction of any evidence unless plaintiff would deposit a certain sum of money with the clerk. Plaintiff declining to obey this preliminary order, a nonsuit was entered and a judgment of dismissal was given. Plaintiff's motion for a new trial was denied and on appeal the court reversed the order denying it, saying, in part: "The trial of a cause includes all the rulings of the court and the proceedings before it which conduce to the decision which it makes upon the issues in the case as the basis of its judgment. (People v. Turner, 39 Cal. 370;Moore v. Bates, 46 Cal. 29.) Any erroneous ruling, by virtue of which a party is precluded from introducing evidence in support of his cause of action as set forth in his complaint or his defense, is an error of law occurring at the trial. The action of the court in improperly *Page 144 granting or refusing a nonsuit is also an error of law, whether made upon the opening statement of counsel or after the close of the evidence in the cause. (Craig v. Hesperia Land WaterCo., 107 Cal. 675, [40 P. 1057].) Under these principles, the order of the court requiring the plaintiffs to pay into court the sum of twenty-five thousand dollars, as a condition upon which they could proceed to trial, and the order granting a nonsuit upon the opening statement and admissions of their counsel, may be reviewed as errors of law occurring at the trial." Respondent is of the opinion that in essence the judgment entered in the superior court in Ewell v. McKenzie etal. was a judgment of nonsuit, and that calling it by another name does not alter that fact. We are constrained to agree with this view, and we believe that Green v. Duvergey, supra, supports our conclusion. In that case as in the Ewell case the court declined to hear proffered testimony at the trial. In that case the refusal was regarded as error of law by this court on appeal. In the Ewell case the judge who made the ruling excluding the evidence believed that he had committed error and sought to give appropriate relief. That one error was due to a misunderstanding of the court's power and the other to a misconception of the sufficiency of a pleading does not, in our opinion, make any difference in regard to the power and jurisdiction of the trial court upon motion for a new trial.
The fact that the judgment itself recites that it was one entered upon the pleadings is not controlling. The whole record is before us, and a recital in the judgment will not prevent this court from examining the entire record for the purpose of learning all of the facts. A new trial may be granted for errors in law, occurring at the trial and excepted to by the party making the application. (Code Civ. Proc., sec. 657, subd. 7.) Judge Hayne, in his work on New Trial and Appeal, uses the following language (vol. I, sec. 1, p. 9, Rev. ed.):
"But errors occurring at the trial, and having an indirect relation to the pleadings, may be ground for a new trial. So at the trial a party may test the question whether his adversary's pleading states a cause of action or defense by objecting to the introduction of any evidence under it, and the ruling upon such objection may be reviewed on motion for new trial." *Page 145
Since the court's ruling upon the exclusion of evidence under the complaint was reviewable as an alleged "error in law, occurring at the trial," we must hold that no successful attack may be made upon the court's jurisdiction to pass upon the motion for a new trial.
The writ of certiorari is discharged.
Victor E. Shaw, J., pro tem., Sloss, J., Wilbur, J., Richards, J., pro tem., Shaw J., and Angellotti, C. J., concurred.
Rehearing denied.