本文整理汇总了C#中System.Exception.ToBugSenseEx方法的典型用法代码示例。如果您正苦于以下问题:C# Exception.ToBugSenseEx方法的具体用法?C# Exception.ToBugSenseEx怎么用?C# Exception.ToBugSenseEx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Exception
的用法示例。
在下文中一共展示了Exception.ToBugSenseEx方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CacheTestHandledException
private string CacheTestHandledException (string uuid)
{
string res = "";
Exception exc1 = new Exception ("Test exception");
var request = new BugSenseExceptionRequest (exc1.ToBugSenseEx (null, true, "", "_ping|ev1|ev2"),
BugSenseEnvironment.GetEnvironment ("test", "0.0.0.0", uuid, true),
new Dictionary<string, string> () {
{ "k1", "val1"},
{ "k2", "val2"},
{ "k3", "val3"}
});
LogError err = new LogError (request, false);
Task.Run (async () => {
res = await err.Execute ();
}).Wait ();
return res;
}
示例2: HandleError
/// <summary>
/// Make sure to set screen size/orientation before calling this!
/// </summary>
public static void HandleError(Exception e, string comment)
{
var request = new BugSenseRequest(e.ToBugSenseEx(comment), Instance.GetEnvironment());
try
{
Instance.Send(request);
}
catch (Exception ex1)
{
}
}
示例3: Handle
private void Handle(Exception e, string comment, NotificationOptions options, bool throwExceptionAfterComplete = false)
{
if (DateTime.Now.AddSeconds(-1) < _lastMethodHandledCalledAt) {
return;
}
_lastMethodHandledCalledAt = DateTime.Now;
if (Debugger.IsAttached && !options.HandleWhileDebugging)//Dont send the error
return;
var request = new BugSenseRequest(e.ToBugSenseEx(comment), GetEnvironment());
if (throwExceptionAfterComplete) {
LogAndSend(request, true);
return;
}
try {
switch (options.Type) {
case enNotificationType.MessageBox:
if (!NotificationBox.IsOpen())
NotificationBox.Show(options.Title, options.Text, new NotificationBoxCommand(Labels.OkMessage, () => { }));
LogAndSend(request);
break;
case enNotificationType.MessageBoxConfirm:
if (!NotificationBox.IsOpen())
Scheduler.Dispatcher.Schedule(
() => {
try {
if (!NotificationBox.IsOpen())
NotificationBox.Show(options.Title, options.Text,
new NotificationBoxCommand(Labels.OkMessage, () => LogAndSend(request)),
new NotificationBoxCommand(Labels.CancelMessage, () => { }));
}
catch { }
});
break;
default:
LogAndSend(request);
break;
}
}
catch (Exception) {
if (options.Type != enNotificationType.MessageBoxConfirm) {
LogAndSend(request);
}
}
}