
153 Ariz. 557 (1987)
739 P.2d 211
McKESSON CHEMICAL CO., A DIVISION OF FOREMOST-McKESSON, INC., Defendant-Appellee,
v.
VAN WATERS & ROGERS, Intervenor Defendant Cross-claimant-Appellant.
No. 1 CA-CIV 8845.
Court of Appeals of Arizona, Division 1, Department A.
May 5, 1987.
*558 Lewis and Roca by John P. Frank, Janet A. Napolitano, Phoenix, and Suciu, Donovan & Schmitt by Robert E. Schmitt, Yuma, for defendant-appellee.
Hunt, Stanley, Hossler & Rourke, Ltd. by David J. Hossler, Karen S. Gaylord, Yuma, for intervenor defendant cross-claimant-appellant.
OPINION
BROOKS, Judge.
The issue presented in this appeal is whether the trial court erred in failing to award attorney's fees to intervenor Van Waters & Rogers against defendant McKesson Chemical Co.
PROCEDURAL HISTORY
This case began as an action between plaintiff OEM Repro Products, Inc. (hereinafter "plaintiff") and defendant McKesson Chemical Co. (hereinafter "McKesson"). McKesson is engaged in the business of distributing chemicals including a chemical known as dibutyl phthalate (hereinafter "DBP"). McKesson sells its DBP in black barrels. Intervenor Van Waters & Rogers (hereinafter "Van Waters") is a competing chemical company and sells its DBP in green barrels with white tops. In June of 1982, McKesson supplied a barrel of DBP to plaintiff. That same month, because DBP was in short supply, McKesson had purchased four barrels of DBP from its competitor Van Waters. McKesson thereafter received a letter of complaint from plaintiff, claiming that the DBP it had received from McKesson was contaminated. McKesson declined to acknowledge or honor plaintiff's claim, and in January of 1983, plaintiff brought suit against McKesson, seeking substantial damages incurred by reason of its use of the defective DBP.
On September 12, 1983, Van Waters received a letter from William Nebeker, then McKesson's attorney, demanding that Van Waters "come in and defend" based upon A.R.S. § 44-2370(E)(1) (now A.R.S. § 47-2607(E)(1)), which provides:
E. Where the buyer is sued for breach of a warranty or other obligation for which his seller is answerable over:
1. He may give his seller written notice of the litigation. If the notice states that the seller may come in and defend and that if the seller does not do so he will be bound in any action against him by his buyer by any determination of fact common to the two litigations, then unless the seller after seasonable receipt of the *559 notice does come in and defend he is so bound.
McKesson claimed that the DBP supplied to plaintiff in June 1982, was one of the four barrels that McKesson had purchased from Van Waters in that same month. Van Waters declined to assume defense of the case. McKesson then filed a motion for leave to file a third-party complaint to add Van Waters and certain other companies as third-party defendants. That motion was denied.
On December 7, 1983, Nebeker sent a second letter to Van Waters, notifying it that McKesson believed that a strong defense could be presented that neither McKesson nor Van Waters was responsible for the contaminated DBP, but that if Van Waters did not voluntarily choose to intervene in the action, McKesson might stipulate to facts with plaintiff designed to allow the jury to find that the defective DBP came from a Van Waters barrel.[1] After reviewing this letter, Van Waters sought leave to intervene pursuant to Rule 24(a), Arizona Rules of Civil Procedure.[2] The trial court granted the motion, allowing Van Waters to intervene as a defendant and as a cross-claimant seeking indemnity, attorney's fees, and costs from McKesson.
After Van Waters concluded discovery and convinced itself that it had not provided McKesson with the barrel containing defective DBP, it filed a motion for summary judgment against both plaintiff and McKesson, which was denied by the trial court. The matter then proceeded to trial, and at the close of plaintiff's case, Van Waters moved for a directed verdict against plaintiff and renewed its motion for summary judgment against McKesson. At this point, the trial court determined that no evidence had been presented nor could be presented that would establish any liability on the part of Van Waters. The trial court therefore granted a directed verdict for Van Waters against plaintiff and a partial summary judgment for Van Waters against McKesson, indicating that the issue of Van Waters' request for attorney's fees against McKesson would be reserved.
Thereafter, a jury verdict was returned in favor of plaintiff against McKesson for $3,128,082.00, and a formal judgment to that effect was entered. The trial court denied Van Waters' request for an award of attorney's fees against McKesson, and it is from this order that Van Waters has appealed to this court.
JURISDICTION
As a preliminary matter, we note that McKesson alleges in the answering brief that the notice of appeal was not timely filed and that this court therefore has no jurisdiction over the appeal. This issue was previously resolved by this court when it denied McKesson's motion to dismiss the appeal, and we decline to reconsider that ruling.
ATTORNEY'S FEES AT TRIAL
Van Waters argues that the trial court erred in ruling that there was "no sufficient basis" to support an award of attorney's fees against McKesson. Van Waters contends that it should have been awarded *560 attorney's fees on any one of three separate bases.[3]

A. A.R.S. § 12-341.01(C)

We first consider Van Waters' argument that it was entitled to an award of attorney's fees pursuant to A.R.S. § 12-341.01(C), which provides that "[r]easonable attorney's fees shall be awarded by the court in any contested action upon clear and convincing evidence that the claim or defense constitutes harassment, is groundless and not made in good faith." Van Waters argues that McKesson had evidence from which it should have known that Van Waters could not possibly have been liable in this case. Van Waters points out that McKesson had the barrel of contaminated DBP, which plaintiff had returned, in its possession throughout the litigation. Van Waters argues that because McKesson knew all along that the barrel was one of its own black barrels and not a green Van Waters barrel, McKesson must have been acting in bad faith in attempting to convince Van Waters that it might be ultimately liable; in indicating to Van Waters that it would consider stipulating with plaintiff to facts that would shift liability to Van Waters; and in opposing Van Waters' motions for summary judgment and for a directed verdict. McKesson responds that there was no clear and convincing evidence of bad faith and that the question of Van Waters' liability remained a debatable issue until trial was well underway.
It is undisputed that plaintiff returned a contaminated barrel of DBP to McKesson, that the barrel was black rather than green, and that McKesson was aware of these facts. The barrel was introduced at trial as Exhibit 12. It was marked with the name, "Moreland-McKesson," and the number, "25280." Plaintiff claimed that McKesson had delivered the barrel to it on June 18, 1982, but plaintiff had no documentation to establish receipt of that barrel on that date.
In October of 1982, a McKesson chemist, Douglas Eisener, conducted an extensive review of company records in an effort to determine whether it was possible that McKesson had delivered Exhibit 12 to plaintiff in June of 1982. Eisener traced the forty-nine barrels of DBP that had been assigned the 25280 lot number and concluded that McKesson could not have had a barrel of 25280 on hand in June of 1982. As he interpreted the records, they showed that McKesson had no DBP in stock at all at that time, which was why it had been necessary to purchase four barrels from Van Waters.
Eisener also found evidence that a barrel of 25280 had been delivered in 1980 to plaintiff's predecessor, Columbia Ribbon, a company that had since declared bankruptcy and whose inventories were later acquired by plaintiff. Eisener concluded that the contaminated barrel was one that plaintiff had purchased from Columbia Ribbon and that it could have been contaminated while in possession of that company. He was convinced that McKesson could not have delivered anything but a green Van Waters barrel to plaintiff in June of 1982.[4]
As a result of Eisener's research, McKesson attempted to bring Van Waters into the case and led Van Waters to believe that some doubt existed as to whether the contaminated barrel had come from the 1982 Van Waters shipment. Such doubt should not have occurred to one in possession of the only barrel alleged to be contaminated, a barrel that everyone agrees could not have come from Van Waters.
Van Waters did not become aware that the contaminated barrel was in fact a black McKesson barrel until about a month before trial, whereupon it filed a motion for summary judgment, and, later, a motion for a directed verdict following opening statements. McKesson and plaintiff successfully opposed these motions, apparently *561 on the grounds that a debatable issue existed as to whether Van Waters was in the chain of distribution for the contaminated DBP. We are convinced, however, that the debatable issue was solely between McKesson and plaintiff and concerned whether McKesson had delivered the black barrel in question to plaintiff in 1982 or to Columbia Ribbon in 1980. In neither case, given that the contaminated barrel was black, could Van Waters have been liable.
However, the question for the trial court, in determining whether to award attorney's fees under A.R.S. § 12-341.01(C), was not only whether the claim against Van Waters was groundless, but also whether it was made in bad faith and constituted harassment. Under the plain language of that section, all three elements must be established by clear and convincing evidence in order to require an award of fees. Although we believe that the record might have supported an award of attorney's fees on this basis, we do not believe that the facts compel such a conclusion. The trial court could have found that McKesson honestly, though mistakenly, believed that its records established the possibility that Van Waters could be liable.

B. Attorney's Fees Incurred in Litigation against a Third Party Resulting from Defendant's Wrongful Act

Van Waters next points out that in United States Fidelity & Guaranty Co. v. Frohmiller, 71 Ariz. 377, 227 P.2d 1007 (1951), our supreme court recognized certain exceptions to the general rule that attorney's fees are not recoverable unless provided for by statute or agreement of the parties. The court quoted one of those exceptions from 15 Am.Jur. Damages § 144 (1938):
It is generally held that where the wrongful act of the defendant has involved the plaintiff in litigation with others or placed him in such relation with others as makes it necessary to incur expense to protect his interest, such costs and expenses, including attorneys' fees, should be treated as the legal consequences of the original wrongful act and may be recovered as damages.
This exception is further explained in 22 Am.Jur.2d Damages § 166 (1965):
In order to recover attorneys' fees under this principle, the plaintiff must show: (1) that the plaintiff had become involved in a legal dispute either because of a breach of contract by the defendant or because of the defendant's tortious conduct; (2) that the dispute is with a third party  not with the defendant; and (3) that the plaintiff incurred attorneys' fees connected with that dispute.
For a defendant's conduct to fall within this exception, however, it must be shown that the defendant acted vexatiously, wantonly, or for oppressive reasons. Taylor v. Southern Pacific Transportation Co., 130 Ariz. 516, 637 P.2d 726 (1981). Van Waters does not dispute that this additional showing is necessary, but argues that the evidence was sufficient to establish those elements. Van Waters further argues that the trial court did not reach the question of whether McKesson's conduct was vexatious, wanton, or oppressive. It contends that the trial court's ruling indicated that it did not even recognize the "wrongful act" test of Frohmiller as one to be considered in this case. We do not agree. The only argument that McKesson made in the trial court against an award of fees under the "wrongful act" basis was that there had been no showing that it had acted vexatiously, wantonly, or oppressively. For the same reason that the trial court could have found that McKesson had not acted in bad faith, it also could have found that McKesson had not acted vexatiously, wantonly, or oppressively.
C. A.R.S. § 12-341.01(A)
We now turn to the question of whether Van Waters was entitled to attorney's fees pursuant to A.R.S. § 12-341.01(A), which provides:
A. In any contested action arising out of a contract, express or implied, the court may award the successful party reasonable attorney's fees.
*562 Awards made pursuant to this statutory subsection are discretionary with the trial court. Suciu v. Amfac Distributing Corp., 138 Ariz. 514, 675 P.2d 1333 (App. 1983).[5]
In arguing that attorney's fees should not be awarded under A.R.S. § 12-341.01(A), McKesson's major contention is that Van Waters did not prevail against it and was therefore not a "successful" party. McKesson seems to concede that if Van Waters had sought a declaratory judgment that it owed no indemnity to McKesson and had been granted this relief, it would have been a "successful" party. McKesson correctly points out, however, that Van Waters did not seek this relief in its pleadings. To the contrary, Van Waters' cross-claim against McKesson sought indemnity from McKesson in the event that Van Waters was found liable to plaintiff. McKesson reasons that when Van Waters was found not to be liable to plaintiff, its cross-claim for indemnity against McKesson became moot. Therefore, the argument continues, even though the trial court stated that it was granting Van Waters relief on its cross-claim against McKesson, there was no relief for Van Waters to obtain against McKesson.
If this case had been tried strictly on the issues raised in the pleadings, we might agree that Van Waters obtained no affirmative relief against McKesson. However, even though Van Waters' pleading was inartfully drafted to seek indemnity against McKesson rather than to seek a ruling that it owed no indemnity to McKesson, it is clear that the latter issue was what was being tried in the case. Rule 15(b), Arizona Rules of Civil Procedure, provides that when issues not raised by the pleadings are tried by express or implied consent of the parties, they shall be treated in all respects as if they had been properly raised.
When Van Waters argued its motion for summary judgment against McKesson along with the motion for directed verdict against plaintiff, Van Waters' counsel made it clear that he was seeking a ruling equivalent to a declaratory judgment that Van Waters could not be held liable to McKesson should McKesson be found liable to plaintiff. Van Waters' counsel acknowledged the defects in its pleadings and asked the court to conform the pleadings to the evidence. Counsel stated:
[MR. HOSSLER]: At any rate, Your Honor, I think it is clear at this time that although our pleadings vis-a-vis McKesson, and they do, they frankly say that we are alleging that if any of our DBP caused any of the problem, it was because they did something to it, meaning McKesson. Well, that is not what happened at all, and what we have tried and what the Court has heard is that McKesson brought us in here when they shouldn't have. They shouldn't have brought us in here, and that is our theory, and that is the motion we made for summary judgment based upon Bill Nebeker's letter to Jane Savard back in the fall of 1983. Frankly I think, thinking back on it, when we filed or were allowed to file our cross-claim against McKesson, which was never answered, by the way, we anticipated McKesson would turn around and send one right back. They never did. And I suppose it is that motion or that pleading that was never filed and should have been filed and has been tried that we ask for a directed verdict against.
So therefore, Your Honor, I am asking that the Court conform the pleadings to the weight of the evidence as it came in, vis-a-vis McKesson and Van Waters, and the Court find that as of this point in time, regardless of the pleadings, there is no issue, there is simply no issue between *563 McKesson and Van Waters. No issue remains regardless of what was pled or wasn't pled, based upon what was tried, and Mr. Eisener's testimony, there is nothing remains but whether or not Van Waters should get attorney's fees against McKesson, and, Your Honor, I suggest that can be resolved after this trial is all over.
McKesson's counsel did not address whether the pleadings should be allowed to be conformed to the evidence. He merely returned to the fact that Van Waters had sought indemnity from McKesson and argued that McKesson was entitled to its own directed verdict on the cross-claim since the issue of indemnity from McKesson was moot.
The trial court ultimately granted Van Waters' motion for summary judgment on the cross-claim against McKesson, calling it a "partial" summary judgment, presumably because the issue of attorney's fees was reserved. The trial court specifically found that "there is no liability on behalf of Van Waters and Rogers to McKesson, regardless of the verdict that might come in for or against the plaintiffs and against the defendant McKesson." The language used clearly indicates that the court was finding no indemnity for McKesson against Van Waters even should McKesson be found liable to plaintiff. The formal order specified that "VAN WATERS & ROGERS was entitled to judgment against McKESSON on the cross-claim and upon any and all claims between VAN WATERS & ROGERS and McKESSON arising out of the transactions involved in the case at bar." (Emphasis added.) There can be no question that the trial court granted Van Waters relief against McKesson and that Van Waters was therefore a "successful" party within the requirements of A.R.S. § 12-341.01(A).
We proceed to the question of whether this was a contested case in which McKesson and Van Waters were adverse parties. Fees pursuant to A.R.S. § 12-341.01(A) are awardable only against a party with adverse interests. Nationwide Resources Corp. v. Ngai, 129 Ariz. 226, 630 P.2d 49 (App. 1981). We find that there can be no dispute that McKesson and Van Waters were adverse parties. McKesson acknowledged in its answering brief filed in this court that McKesson was Van Waters' "real enemy." Van Waters would not have been in the case if McKesson had not indicated that it would try to shift liability to it. McKesson sought to bring Van Waters into the case and thereafter sought to keep it there. Although the two shared some common ground in their attempt to prove that plaintiff or a third party was responsible for the contamination of the DBP, they alternatively sought to prove each other liable. The issues between them were extensively litigated and were therefore "contested" as required by the statute.
The next question is whether the issues between McKesson and Van Waters "arose out of contract." We note that McKesson has made no argument that this requirement of the statute was not met and we are satisfied that it was. Van Waters would not have been involved in the case had it not been for the contract underlying its sale of four barrels of DBP to McKesson. Without this agreement and sale between them, McKesson would have had no claim for shifting liability to Van Waters. The requisite causal link between Van Waters' claims and defenses and the underlying contract is present. Marcus v. Fox, 150 Ariz. 333, 723 P.2d 682 (1986).
Having found that A.R.S. § 12-341.01(A) is applicable to this case, we now turn to McKesson's argument that in denying attorney's fees requested under this subsection, the trial court was simply exercising its discretion. A trial court's exercise of discretion in declining to award attorney's fees pursuant to A.R.S. § 12-341.01(A) will not be overturned unless it is without a reasonable basis. See Associated Indemnity Corp. v. Warner, 143 Ariz. 567, 694 P.2d 1181 (1985). In the instant case, however, the trial court did not indicate the basis for its denial of fees. We do not know whether the trial court found that Van Waters was precluded from recovering attorney's fees under A.R.S. § 12-341.01(A) as a matter of law, or *564 whether the trial court simply declined to award attorney's fees under this subsection in the exercise of its discretion. If the basis for the ruling was that Van Waters was precluded as a matter of law from recovering its attorney's fees, we disagree and direct the trial court to decide how best to exercise its discretion. If, however, the trial court recognized that attorney's fees could be awarded, but declined to award them, we have difficulty discerning a reasonable basis for such a ruling from our review of the record. Accordingly, on remand, if the trial court declines to award attorney's fees in the exercise of its discretion, we encourage the court to set forth its reasons therefor.
APPORTIONMENT OF ATTORNEY'S FEES
This brings us to McKesson's argument that any fees awardable to Van Waters would have to be apportioned against both plaintiff and McKesson because Van Waters was successful against both. However, Van Waters sought attorney's fees solely against McKesson and contends that McKesson should bear the full burden of any fees awarded. We agree.
Van Waters entered the litigation as an intervenor/defendant and cross-claimant in order to assert both its own defenses to any claim McKesson had against it and McKesson's defenses against the plaintiff. Van Waters intervened only because it believed from McKesson's letter that McKesson would seek to hold it liable if McKesson were found liable to plaintiff. Plaintiff, however, did not seek to bring Van Waters into the action; in fact plaintiff opposed the motion to intervene. Moreover, both Van Waters and McKesson were unsuccessful in trying to prove that McKesson was not liable to plaintiff. Even though the trial court stated that it was granting relief to Van Waters against both plaintiff and McKesson, Van Waters' only meaningful success was on its cross-claim against McKesson. We hold that under the circumstances of this case, McKesson would be solely liable for any fees that the trial court might award under A.R.S. § 12-341.01(A).
ATTORNEY'S FEES ON APPEAL
Van Waters has requested an award of attorney's fees on appeal, and the request is granted in an amount to be determined pursuant to Rule 21(c), Arizona Rules of Civil Appellate Procedure.
CONCLUSION
This matter is remanded to the trial court for proceedings consistent with this opinion.
CONTRERAS, P.J., and STOOPS, J. Pro Tem., concur.
NOTE: The Honorable DANIEL J. STOOPS, Judge pro tempore, was authorized to participate by the Chief Justice of the Arizona Supreme Court pursuant to Arizona Const. art. VI, § 3.
NOTES
[1]  The letter stated in pertinent part:

... it is my opinion that if a jury concludes that the damage occurred because of a contaminated barrel that McKesson purchased from Van Waters & Rogers, McKesson's suit for indemnity would be assured of success. The plaintiff's attorney has approached me with a proposal which would assure the jury finding such to be the case. I do not wish to enter into such an agreement but will do so if I conclude it is the best method to insure protection for McKesson Chemical Corporation. One of the reasons that I am reluctant to do this is because I feel there are some valid defenses to this case which would allow Van Waters & Rogers to win on the merits should they accept our tender of defense.
(Emphasis added.)
[2]  The rule provides:

24(a) Intervention of right. Upon timely application anyone shall be permitted to intervene in an action: (1) when a statute confers an unconditional right to intervene; or (2) when the applicant claims an interest relating to the property or transaction which is the subject of the action and he is so situated that the disposition of the action may as a practical matter impair or impede his ability to protect that interest.
[3]  Van Waters did not claim attorney's fees under A.R.S. § 12-349 (added by Laws 1985, Ch. 225, § 1), and we do not address the applicability of that section to this case.
[4]  It was only a few days before trial that McKesson discovered documentary evidence that raised the possibility that it had one barrel of DBP in its possession in June of 1982 and that the barrel might have been from lot 25280.
[5]  We note that McKesson has argued that under Rollison v. Hotel, Motel, Restaurant & Constr. Camp Employees Local 879, 677 F.2d 741 (9th Cir.1982), Van Waters, as an intervenor, is not entitled to recover any of its attorney's fees in this litigation because it has made no showing that it contributed anything to McKesson's defense against the plaintiff. Van Waters, however, did not request attorney's fees solely as an intervenor. The fact that Van Waters might not have been entitled to recover attorney's fees under the Rollison rule does not preclude it from seeking recovery of fees as a successful cross-claimant under A.R.S. § 12-341.01(A).
