diff --git a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataSessionWriter.cs b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataSessionWriter.cs index 9a5b767e75..4e12446edd 100644 --- a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataSessionWriter.cs +++ b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataSessionWriter.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.Data.SQLite; using System.Globalization; +using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Text; using System.Threading; @@ -286,7 +287,7 @@ namespace ICSharpCode.UsageDataCollector { if (exception == null) throw new ArgumentNullException("exception"); - string exceptionType = exception.GetType().FullName; + string exceptionType = GetTypeName(exception); string stacktrace = exception.StackTrace; while (exception.InnerException != null) { exception = exception.InnerException; @@ -294,11 +295,21 @@ namespace ICSharpCode.UsageDataCollector stacktrace = exception.StackTrace + Environment.NewLine + "-- continuing with outer exception (" + exceptionType + ") --" + Environment.NewLine + stacktrace; - exceptionType = exception.GetType().FullName; + exceptionType = GetTypeName(exception); } AddException(exceptionType, stacktrace); } + static string GetTypeName(Exception exception) + { + string type = exception.GetType().FullName; + ExternalException ee = exception as ExternalException; + if (ee != null) + return type + " (ErrorCode " + ee.ErrorCode.ToString("x8") + ")"; + else + return type; + } + /// /// Adds an exception report to the session. /// diff --git a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataUploader.cs b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataUploader.cs index 3280b09c91..a7d8625191 100644 --- a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataUploader.cs +++ b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataUploader.cs @@ -115,7 +115,6 @@ namespace ICSharpCode.UsageDataCollector } data = ms.ToArray(); } - File.WriteAllBytes(Path.Combine(Path.GetTempPath(), "SharpDevelopUsageData.xml.gz"), data); UDCUploadServiceClient client = new UDCUploadServiceClient(binding, endpoint); try {