I have this code:
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 },
});
}
}
There was an exception and I was expecting to see information such as the ex string (more than a few words), Device Name and Model.
But AppCenter only tells me:
Stack traces Button.ChangeTheColours (System.Object sender, System.EventArgs e) Templates/Button/Button.xaml.cs:83
and doesn't give any more information about the exception or the Device Name and Model.
Is there something I am doing incorrectly with trying to detect crashes like this? Note that I realise a throw would normally be needed but this is a special case for this error.