private static void showNonJira503Errors(IEnumerable <Exception> exceptions, string msg) { StringBuilder sb = new StringBuilder(); List <Exception> exList = new List <Exception>(exceptions); int i = 0; foreach (Exception exception in exList) { sb.Append(getExceptionMessage(exception)).Append(getExceptionDetailsLink("" + i)); ++i; if (i < exList.Count) { sb.Append("<br>\r\n"); } } MessageBoxWithHtml.showError(Constants.ERROR_CAPTION, (msg != null ? msg + "<br>\r\n<br>\r\n" : "") + sb, delegate { sb = new StringBuilder(); foreach (var exception in exList) { sb.Append(getFullExceptionTextDetails(msg, exception)); sb.Append("\r\n"); } Clipboard.SetText(sb.ToString()); }, delegate(string tag) { int idx = int.Parse(tag); new ExceptionViewer(null, exList[idx]).ShowDialog(); }); }
private static void showSoapError(SoapException e, string msg) { MessageBoxWithHtml.showError( Constants.ERROR_CAPTION, e.Message + getExceptionDetailsLink("eSoap"), () => Clipboard.SetText(e.Detail.Name + ": " + e.Detail.Value + "\r\n\r\n" + getFullExceptionTextDetails(msg, e)), delegate { new ExceptionViewer(e.Detail.Name + ": " + e.Detail.Value, e).ShowDialog(); }); }
private static void showXmlDocumentError(XPathUtils.InvalidXmlDocumentException e, string msg) { MessageBoxWithHtml.showError( Constants.ERROR_CAPTION, e.Message + getExceptionDetailsLink("eXml"), () => Clipboard.SetText((msg != null ? msg + "\r\n\r\n" : "") + e.SourceDoc), delegate { new ExceptionViewer(e.SourceDoc, e).ShowDialog(); }); }
private static void show503Error(FiveOhThreeJiraException e503, string msg) { MessageBoxWithHtml.showError( Constants.ERROR_CAPTION, getJira503Description(e503.Server), () => Clipboard.SetText(getFullExceptionTextDetails(msg, e503)), null); }
public static void showError(string msg, Exception e) { FiveOhThreeJiraException e503 = e as FiveOhThreeJiraException; XPathUtils.InvalidXmlDocumentException eXml = e as XPathUtils.InvalidXmlDocumentException; if (e503 != null) { show503Error(e503, msg); } else if (eXml != null) { showXmlDocumentError(eXml, msg); } else { string exceptionMessage = getExceptionMessage(e) + getExceptionDetailsLink("ex"); MessageBoxWithHtml.showError( Constants.ERROR_CAPTION, (msg != null ? msg + "<br>\r\n<br>\r\n" : "") + exceptionMessage, () => Clipboard.SetText(getFullExceptionTextDetails(msg, e)), delegate { new ExceptionViewer(msg, e).ShowDialog(); }); } }