Browse Source

UsageDataCollector: include the error code in exception reports for ExternalExceptions (COMException etc.)

Removed debugging statement that saved usage data into temporary file during upload.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5424 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
c14c5ab1c5
  1. 15
      src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataSessionWriter.cs
  2. 1
      src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataUploader.cs

15
src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataSessionWriter.cs

@ -9,6 +9,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data.SQLite; using System.Data.SQLite;
using System.Globalization; using System.Globalization;
using System.Runtime.InteropServices;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
@ -286,7 +287,7 @@ namespace ICSharpCode.UsageDataCollector
{ {
if (exception == null) if (exception == null)
throw new ArgumentNullException("exception"); throw new ArgumentNullException("exception");
string exceptionType = exception.GetType().FullName; string exceptionType = GetTypeName(exception);
string stacktrace = exception.StackTrace; string stacktrace = exception.StackTrace;
while (exception.InnerException != null) { while (exception.InnerException != null) {
exception = exception.InnerException; exception = exception.InnerException;
@ -294,11 +295,21 @@ namespace ICSharpCode.UsageDataCollector
stacktrace = exception.StackTrace + Environment.NewLine stacktrace = exception.StackTrace + Environment.NewLine
+ "-- continuing with outer exception (" + exceptionType + ") --" + Environment.NewLine + "-- continuing with outer exception (" + exceptionType + ") --" + Environment.NewLine
+ stacktrace; + stacktrace;
exceptionType = exception.GetType().FullName; exceptionType = GetTypeName(exception);
} }
AddException(exceptionType, stacktrace); 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;
}
/// <summary> /// <summary>
/// Adds an exception report to the session. /// Adds an exception report to the session.
/// </summary> /// </summary>

1
src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataUploader.cs

@ -115,7 +115,6 @@ namespace ICSharpCode.UsageDataCollector
} }
data = ms.ToArray(); data = ms.ToArray();
} }
File.WriteAllBytes(Path.Combine(Path.GetTempPath(), "SharpDevelopUsageData.xml.gz"), data);
UDCUploadServiceClient client = new UDCUploadServiceClient(binding, endpoint); UDCUploadServiceClient client = new UDCUploadServiceClient(binding, endpoint);
try { try {

Loading…
Cancel
Save