using System; using MbUnit.Core.Reports.Serialization; namespace MbUnit.ReSharperRunner.MbUnit { internal class RunnerException : Exception { private readonly ReportException reportException; private readonly string exceptionType; private static Exception FromReportException(ReportException e) { if (e == null) { return null; } else { return new RunnerException(e); } } public RunnerException(ReportException e) : base(e.Message, FromReportException(e.Exception)) { exceptionType = e.Type; reportException = e; } public override string Message { get { return string.Format("{0}: {1}", exceptionType, base.Message); } } public override string StackTrace { get { return reportException.Type + Environment.NewLine + reportException.StackTrace; } } public override string ToString() { return reportException.Type; } public override string Source { get { return reportException.Source; } set { reportException.Source = value; } } } }