Ala*_*an2 3 c# xamarin xamarin.forms visual-studio-app-center
我有这个代码:
private async void ChangeTheColours(Object sender, EventArgs e)
{
try
{
if ((string)this.ButtonLabel.Text.Substring(0, 1) != " ")
{
ConfigureColors((Button)sender, "C");
await Task.Delay(200);
ConfigureColors((Button)sender, State);
}
}
catch (Exception ex)
{
Crashes.TrackError(ex,
new Dictionary<string, string> {
{"ChangeTheColours", "Exception"},
{"Device Name", DeviceInfo.Name },
{"Device Model", DeviceInfo.Model },
});
}
}
Run Code Online (Sandbox Code Playgroud)
有一个例外,我希望看到诸如 ex 字符串(超过几个单词)、设备名称和型号等信息。
但AppCenter只告诉我:
堆栈跟踪 Button.ChangeTheColours (System.Object sender, System.EventArgs e) Templates/Button/Button.xaml.cs:83
并且没有提供有关异常或设备名称和型号的更多信息。
我在尝试检测这样的崩溃时是否做错了什么?请注意,我意识到通常需要抛出异常,但这是此错误的特殊情况。
| 归档时间: |
|
| 查看次数: |
1384 次 |
| 最近记录: |