Browse Source

Upload the full stack trace (including inner exceptions)

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4941 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 16 years ago
parent
commit
bcdb9822f4
  1. 3
      src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/AnalyticsMonitor.cs
  2. 22
      src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataSessionWriter.cs
  3. 7
      src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataUploader.cs

3
src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/AnalyticsMonitor.cs

@ -148,8 +148,7 @@ namespace ICSharpCode.UsageDataCollector @@ -148,8 +148,7 @@ namespace ICSharpCode.UsageDataCollector
{
lock (lockObj) {
if (session != null) {
// TODO: recognize inner exceptions
session.AddException(exception.GetType().FullName, exception.StackTrace);
session.AddException(exception);
}
}
}

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

@ -10,6 +10,7 @@ using System.Collections.Generic; @@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.Data.SQLite;
using System.Globalization;
using System.Runtime.Serialization;
using System.Text;
using System.Threading;
namespace ICSharpCode.UsageDataCollector
@ -277,6 +278,27 @@ namespace ICSharpCode.UsageDataCollector @@ -277,6 +278,27 @@ namespace ICSharpCode.UsageDataCollector
}
}
/// <summary>
/// Adds an exception report to the session.
/// </summary>
/// <param name="exception">The exception instance.</param>
public void AddException(Exception exception)
{
if (exception == null)
throw new ArgumentNullException("exception");
string exceptionType = exception.GetType().FullName;
string stacktrace = exception.StackTrace;
while (exception.InnerException != null) {
exception = exception.InnerException;
stacktrace = exception.StackTrace + Environment.NewLine
+ "-- continuing with outer exception (" + exceptionType + ") --" + Environment.NewLine
+ stacktrace;
exceptionType = exception.GetType().FullName;
}
AddException(exceptionType, stacktrace);
}
/// <summary>
/// Adds an exception report to the session.
/// </summary>

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

@ -130,15 +130,18 @@ namespace ICSharpCode.UsageDataCollector @@ -130,15 +130,18 @@ namespace ICSharpCode.UsageDataCollector
void UsageDataUploaded(IAsyncResult result, UDCUploadServiceClient client, string commaSeparatedSessionIDList)
{
bool success = false;
try {
client.EndUploadUsageData(result);
success = true;
} catch (EndpointNotFoundException) {
// ignore error (maybe currently not connected to network)
}
client.Close();
RemoveUploadedData(commaSeparatedSessionIDList);
if (success) {
RemoveUploadedData(commaSeparatedSessionIDList);
}
}
Version expectedDBVersion = new Version(1, 0, 1);

Loading…
Cancel
Save