Alan2
Alan2

Reputation: 24572

Xamarin AppCenter Crashes.TrackError not showing details I expect in AppCenter

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.

Upvotes: 3

Views: 1501

Answers (1)

OliveJuice
OliveJuice

Reputation: 378

Couple things. First, I think that this page might explain why your exception message is cut a little short. I'm not quite sure if the 125 character limit applies to the exception itself.

Second, you don't see much data without looking at the individual error report. To view a specific instance -

  1. Click "Diagnostics" in the left nav
  2. Select the Error you are trying to inspect
  3. Near the top, select "Reports", this shows the individual instances with timestamps
  4. Select an instance
  5. Near the bottom, you will see an area titled "Error Properties" that should show your dictionary data you included in your error.

Upvotes: 5

Related Questions