
481 S.E.2d 504 (1996)
198 W.Va. 409
STATE of West Virginia ex rel. James A. DODRILL, Defendant Below, Petitioner,
v.
Honorable L.D. EGNOR, Jr., Judge of the Circuit Court of Cabell County, Respondent, and
Linda K. Hodges and Daniel E. Hodges, Plaintiffs Below, Respondents.
No. 23661.
Supreme Court of Appeals of West Virginia.
Submitted October 29, 1996.
Decided December 20, 1996.
*506 Anita R. Casey, Meyer, Darragh, Buckler, Bebenek & Eck, Charleston, for Petitioner.
John Hedges, Byrne & Hedges, Morgantown, for Respondent, Hon. L.D. Egnor, Jr.
R. Edison Hill, Hill, Peterson, Carper, Bee & Deitzler, Charleston, Counsel for Respondents, Linda K. and Daniel E. Hodges.
*505 PER CURIAM:
The Petitioner, James A. Dodrill, seeks a writ of prohibition against the Honorable L.D. Egnor, Jr., to prevent enforcement of an order directing Mr. Dodrill to pay the legal expenses incurred by the Respondents, Linda K. and Daniel E. Hodges, to oppose a prior petition for a writ of prohibition filed by Mr. Dodrill in this Court. For the reasons set out below, we grant the writ requested and remand the case for a hearing.[1]
This lawsuit began as a negligence action arising out of a motor vehicle accident. The issues of liability and damages were bifurcated for separate trial. Prior to trial, the defendants, by their counsel, Mr. Dodrill, requested that the plaintiff/Respondent, Linda K. Hodges, be examined by an orthopedist, Dr. Paul Bachwitt. Dr. Bachwitt examined Mrs. Hodges on March 7, 1996. At trial on the issue of liability, the jury returned a verdict for the defendants. Because the defendants were not liable, the issue of damages never went to trial, and Dr. Bachwitt's report was not needed.
Sometime after the verdict, but prior to entry of judgment, counsel for Mrs. Hodges requested a copy of Dr. Bachwitt's report. The Petitioner refused in a letter to the Hodges' attorney, saying that the report was not in issue any more, and further, "If you want the report you will have to pay for it." The plaintiffs/Respondents filed a motion to compel disclosure of the report. On June 26, 1996 the Respondent, Judge Egnor, entered both a judgment order pursuant to the jury verdict, and an order directing the Petitioner to produce the report of the medical examination without cost to the plaintiffs. Subsequent correspondence from Petitioner Dodrill to the plaintiffs' counsel indicates that he considered the circuit court's order "void," because "Judge Egnor lost jurisdiction to rule with regard to discovery matters once this case was adjudicated on its merits."[2]*507 When the report was not forthcoming, counsel for the plaintiffs filed a motion in circuit court asking the court to hold Petitioner Dodrill in contempt for failure to produce the medical report as ordered, and requesting an award of attorney's fees against the Petitioner for requiring plaintiffs' counsel to file two motions and attend two hearings in order to obtain the report of a medical exam to which Mrs. Hodges had submitted at the Petitioner's request. Hearing on that motion was set for August 26.
Meanwhile, Mr. Dodrill filed a petition for a writ of prohibition in this Court, seeking to prevent enforcement of the circuit court's June 26 order. That petition was denied on August 13. On Friday, August 23, the Petitioner faxed a copy of the medical report to the Hodges' attorney. The following Monday was the day set for hearing the plaintiffs' contempt motion. The plaintiffs' attorney called Judge Egnor's office and left a message with the judge's secretary that no hearing would be necessary. After being advised that the document had been produced the preceding Friday, the Respondent, Judge Egnor, contacted the plaintiffs' attorney. He asked how much time the attorney had spent defending the first petition, and asked to see the document that Petitioner Dodrill had produced. Counsel responded that he had spent 12.75 hours on the matter, and forwarded the medical report, along with the cover letter that the Petitioner had attached. The tone of the letter was openly hostile, and it included disparaging comments about the trial court, referring to "the inability, in my opinion, of the trial court to correctly and completely grasp the legal concepts," "the illogical and erroneous rulings of the court during trial," and "the patently and abhorrently erroneous rulings by the trial court."
Judge Egnor issued an order finding that Mr. Dodrill's failure to produce "was without reason and violative of the basic rules of etiquette, common sense and human and civil deportment," and that he had "wrongfully and unnecessarily required plaintiffs' counsel to oppose a groundless petition for a writ of prohibition." The Court therefore on its own motion imposed sanctions against Mr. Dodrill, and ordered him to pay $1,950 to the plaintiffs' attorney for his work in opposing the petition.
Mr. Dodrill asks this Court to prohibit enforcement of the circuit court's order, asserting that the circuit court exceeded its jurisdiction and usurped the power of this Court when it ordered the Petitioner to pay attorney's fees associated with the first writ of prohibition. The Petitioner also asserts as error the circuit court's ex parte communication with plaintiffs' counsel and its sua sponte order of sanctions without notice to Petitioner or an opportunity to be heard.
Petitioner Dodrill first asserts that the trial court lacked jurisdiction over discovery after it entered judgment for the defendants on the issue of liability. We recently addressed the issue of a trial court's jurisdiction to entertain sanctions after the entry of judgment in Bartles v. Hinkle, 196 W.Va. 381, 472 S.E.2d 827 (1996). In Bartles, plaintiffs injured in an accident involving a Domino's Pizza delivery truck sued Domino's, among others. After a jury found that Domino's was not liable for damages, the plaintiffs filed a motion for new trial, which was denied, and an appeal to this Court, which was also denied. Attached to the appeal was a motion for sanctions. During the course of the litigation there had been a protracted dispute over Domino's disclosure of certain documents and information, and the plaintiffs had filed three motions for sanctions against Domino's for failure to comply with discovery requests. Following the unsuccessful appeal to this Court, the trial court held a hearing on the issue of sanctions, and ordered Domino's to pay the plaintiffs $10,000 for willful failure to comply with discovery orders. Domino's appealed that order to this Court, asserting, among other errors, that the trial court lacked jurisdiction to entertain the issue of sanctions after this Court refused the plaintiffs' petition for appeal. This Court found that because there was a motion pending in the trial court at the time of the *508 appeal, jurisdiction over that issue remained with the trial court, and this Court had no power to decide it. "A trial court is deprived of jurisdiction only when it has entered a `final' order within the contemplation of WVA.Code, 58-5-1 [1926], and the final order has been appealed properly to this Court." 196 W.Va. at 388, 472 S.E.2d at 834.
In Bartles, discovery had been ordered prior to the trial on the issue of liability. 196 W.Va. at 386, 472 S.E.2d at 832. That is not true in this case. This Court based its decision in Bartles, however, on the fact that motions for sanctions had been filed in the trial court and had not yet been ruled upon. Therefore the trial court's ruling on sanctions was not properly a part of the appeal that was denied. Id. at 388, 472 S.E.2d at 834. In the case before us, the plaintiffs had a request for production of the medical report outstanding at the time judgment was entered on the issue of liability.[3] Based on our decision in Bartles, we conclude that the circuit court's determination on the issue of liability did not terminate its jurisdiction over the pending discovery matter.
Next, the Petitioner contends that only this Court may award costs associated with a petition for a writ of prohibition filed in the Supreme Court of Appeals. He points to West Virginia Code section 53-1-8 (1994), titled "Award or denial of writ; costs," which provides: "The writ peremptory shall be awarded or denied according to the law and facts of the case, and with or without costs, as the court or judge may determine." While we agree that a court considering a peremptory writ has discretion to award costs associated with it, we do not believe that section 53-1-8 controls in this case. Rather, as the Respondents point out, we look to our law regarding the authority of a court to impose sanctions for failure to obey a discovery order.[4] As we said in the syllabus of Daily Gazette Co. v. Canady, 175 W.Va. 249, 332 S.E.2d 262 (1985):
A court may order payment by an attorney to a prevailing party reasonable attorney fees and costs incurred as the result of his or her vexatious, wanton, or oppressive assertion of a claim or defense that cannot be supported by a good faith argument for the application, extension, modification, or reversal of existing law.
This Court also has held:
Under Rule 37(b)(2)(E) of the West Virginia Rules of Civil Procedure, a court shall require a party failing to obey the order or the attorney advising him or both to pay the reasonable expenses, including attorney's fees, caused by the failure. This provision allows attorney's fees to be excused unless the failure was substantially justified or such an award would be unjust. The rule clearly states that such sanctions may be imposed in lieu of or in addition to any other sanctions. *509 Syl. Pt. 7, State Farm Mut. Auto. Ins. Co. v. Stephens, 188 W.Va. 622, 425 S.E.2d 577 (1992). The circuit court thus had the authority to impose sanctions in the case before us, if warranted by the facts, and was not deprived of such authority by the filing and denial of the Petitioner's first petition for a writ of prohibition.
Finally, the Petitioner asserts that the trial court erred in awarding attorney's fees on its own motion, based on an ex parte communication with the plaintiffs' lawyer. We have determined that the trial court had jurisdiction, and therefore our standard of review is that set out in syllabus point one of Hinkle v. Black, 164 W.Va. 112, 262 S.E.2d 744 (1979):
In determining whether to grant a rule to show cause in prohibition when a court is not acting in excess of its jurisdiction, this Court will look to the adequacy of other available remedies such as appeal and to the over-all economy of effort and money among litigants, lawyers and courts; however, this Court will use prohibition in this discretionary way to correct only substantial, clear-cut legal errors plainly in contravention of a clear statutory, constitutional, or common law mandate which may be resolved independently of any disputed facts and only in cases where there is a high probability that the trial will be completely reversed if the error is not corrected in advance.
The relevant question for purposes of this case is whether there were "substantial, clear-cut legal errors plainly in contravention of a clear statutory, constitutional, or common law mandate."
In determining whether there was substantial error, we look to the procedural guidelines set out in the Bartles decision:
Although Rules 11, 16, and 37 of the West Virginia Rules of Civil Procedure do not formally require any particular procedure, before issuing a sanction, a court must ensure it has an adequate foundation either pursuant to the rules or by virtue of its inherent powers to exercise its authority. The Due Process Clause of Section 10 of Article III of the West Virginia Constitution requires that there exist a relationship between the sanctioned party's misconduct and the matters in controversy such that the transgression threatens to interfere with the rightful decision of the case. Thus, a court must ensure any sanction imposed is fashioned to address the identified harm caused by the party's misconduct.
In formulating the appropriate sanction, a court shall be guided by equitable principles. Initially, the court must identify the alleged wrongful conduct and determine if it warrants a sanction. The court must explain its reasons clearly on the record if it decides a sanction is appropriate. To determine what will constitute an appropriate sanction, the court may consider the seriousness of the conduct, the impact the conduct had in the case and in the administration of justice, any mitigating circumstances, and whether the conduct was an isolated occurrence or was a pattern of wrongdoing throughout the case."
196 W.Va. at 384, 472 S.E.2d at 830, Syl. Pts. 1 & 2.
When Judge Egnor discovered that Dr. Bachwitt's medical report had been turned over to the plaintiffs shortly before the date scheduled for hearing on the motion for contempt, he contacted the plaintiffs' attorney for information relating to the imposition of sanctions, namely the amount of time the attorney had spent preparing a response to the first writ of prohibition. In the course of their communication, Judge Egnor also received a copy of a highly inflammatory communication from the Petitioner to plaintiffs' counsel. In such a situation, fairness dictates that the Petitioner should also have been given the opportunity to be heard on the issue of whether sanctions were justified and to submit evidence and argument on this issue. We noted in Bartles that ordinarily a party about to be sanctioned is given an opportunity to explain the default or to argue for a lesser penalty. 196 W.Va. at 390, 472 S.E.2d at 836. When a court seeks information on an issue, it must give all parties an opportunity to provide such information.
It does not appear from the record that the Petitioner ever had an opportunity to *510 articulate his position on this issue to the circuit court. Petitioner should have been allowed to explain his position, because it bears on the issue of whether he acted in good faith in filing the first petition. In addition, the circuit court should have allowed the Petitioner to present evidence on the appropriate amount of sanctions, because that information was sought by the court and elicited only from plaintiffs' counsel. By soliciting input from one party, and offering the opposing party no opportunity to be heard, Judge Egnor acted in clear contravention of the procedural standards set out in Bartles.
Because we find that the trial court should have allowed the Petitioner to present evidence prior to the imposition of sanctions, we grant the writ as moulded, and remand the case to the circuit court for a hearing consistent with this opinion.
Writ granted as moulded.
RECHT, J., sitting by temporary assignment.
NOTES
[1]  The Honorable Arthur M. Recht resigned as Justice of the West Virginia Supreme Court of Appeals effective October 15, 1996. The Honorable Gaston Caperton, Governor of the State of West Virginia, appointed him Judge of the First Judicial Circuit on that same date. Pursuant to an administrative order entered by this Court on October 15, 1996, Judge Recht was assigned to sit as a member of the West Virginia Supreme Court of Appeals commencing October 15, 1996, and continuing until further order of this Court.
[2]  In a letter dated July 1, 1996, which was attached as an exhibit to Respondents' motion for contempt, the Petitioner wrote to Respondents' counsel:

As both West Virginia and United States Supreme Court law provide, Judge Egnor lost jurisdiction to rule with regard to discovery matters once this case was adjudicated on its merits. Thus, the order which you say was entered after the entry of the judgment order is, in the words of more than one court, "void." You should take a close look at the law with regard to enforcing such orders before you attempt to haul me before the court seeking a citation of contempt. Judge Egnor had no authority to make the order, it is void and it cannot be enforced by contempt proceedings.
[3]  There is some disagreement about whether the plaintiffs' interrogatories and requests for production of documents properly requested the medical report in issue. See infra note 4. The parties do not dispute, however, that plaintiffs' counsel requested the report prior to the circuit court's entry of judgment on the issue of liability.
[4]  Judge Egnor's order does not make clear whether the award of attorney's fees was intended to be a Rule 11 sanction for interposing a pleading for purposes of delay or harassment, or a Rule 37 sanction for failure to obey a discovery order. See WVA. R.Civ.P. 11, 37(b)(2)(E). The Respondent judge in his brief relies primarily on Rule 37(b)(2), but the Petitioner contends that Rule 37 does not apply because the plaintiffs failed to request the report as required by W.Va. R.Civ.P. 35(b). Rule 35(b) requires the party requesting an examination to provide a physician's report to the person examined if requested by that person. Plaintiffs/Respondents reply that they requested the report in their interrogatories and requests for production of documents. The record indicates that Plaintiffs' Interrogatory 59 asked for the names of all witnesses which the defendants intended to call, and the general nature of their expected testimony. Interrogatory 60 asked the defendant to identify all expert witnesses, state the subject matter, substance of facts and opinions and a summary of the grounds therefor on which the expert was expected to testify. Interrogatory 62 asked the defendants to identify all documentary evidence which defendants expected to introduce as evidence at trial. Whether the report was properly requested is clouded by the fact that the case never progressed far enough for the defendants to have identified what evidence they intended to use at trial. If there was no underlying discovery request, this should probably be viewed as a Rule 11 sanction. In any case, the circuit court should identify the basis for its order.
