Provide more context for async errors in C# providers
gshackles
Posted on
Nov 13 2013
I'm not sure if this should be classified as a bug report or a feature request, so I figured I'd just start here. I'm hitting some scenarios in my apps where exceptions are being thrown (and caught, and subsequently sent to Raygun) from async methods. The stacktrace visible in the dashboard just shows one stacktrace which doesn't provide any valuable information. I see from the code that it is just creating a StackTrace object from the exception and using that, so this makes sense.
That said, if you ToString() the exception in code there's a few more stacktraces available that provide much better context into where the error came from. Mono's implementation is a good example of where this comes from. Would it be possible to include something like this in the Raygun report, or, at the very least, also provide the ToString() output? I'm currently doing this from a Xamarin.iOS app, but judging from the code it looks like it would apply across the board.
John-Daniel Trask
Raygun
Posted on
Nov 14 2013
Hi
Thanks for this suggestion. We are looking into this for you now and will let you know how it goes.
-Jason
John-Daniel Trask
Raygun
Posted on
Nov 15 2013
Hi
I've updated the Xamarin.iOS provider to use the StackTrace string from the exception to provide all the stack trace information. This is available right now from GitHub. If you require the NuGet package or Xamarin Component to be updated, let me know. Thanks again for this great suggestion!
-Jason
gshackles
Posted on
Nov 15 2013
Thanks for the quick fix! What's the timeline on getting the component updated? That would be ideal, but I'm happy to just grab it from GitHub if that's going to take some time.
John-Daniel Trask
Raygun
Posted on
Nov 15 2013
It will take a few days before the Xamarin Component is approved. In the mean time, if you don't mind, please try out the GitHub code for the next few days and let us know any feedback/adjustments we need to make which we could roll in before the component goes live.
-Jason
gshackles
Posted on
Nov 16 2013
No problem, will do.
Is there a reason the change was only made for iOS? This situation is going to happen in all of the C# platforms.
John-Daniel Trask
Raygun
Posted on
Nov 18 2013
This is quite a change for how the stack trace data is gathered for this provider. It now entirely gets the stack trace by parsing the stack trace string. I've tested this approach, but want to make sure it works well and satisfies your scenario before working on the other providers. If there are particular C# platforms you would like this support in, let me know and I'll prioritise on those.
-Jason
gshackles
Posted on
Nov 21 2013
My initial tests of the new provider are looking good, thanks! I will report back if I notice any problems as I use it more.
John-Daniel Trask
Raygun
Posted on
Nov 22 2013
Excellent, thanks for the feedback. You can expect the Xamarin Component to be updated early next week.
-Jason
gshackles
Posted on
Apr 01 2014
It looks like this change never made it into the Xamarin.Android build for Raygun. Would it be possible to add it there as well? I'm currently in the same situation on Android that I was when I reported this about iOS - getting error reports that have no useful information in them.
Thanks!
Jason Fauchelle
Raygun
Posted on
Apr 01 2014
Hello
Indeed this was only ever added to the Xamarin.iOS provider. I'll work on implementing this in the Xamarin.Android provider for you this week.
-Jason Fauchelle
Jason Fauchelle
Raygun
Posted on
Apr 02 2014
Hello
I've updated the Xamarin.Android provider to create the stack trace in the same way as the Xamarin.iOS provider so that additional information is gathered for exceptions that occur in async methods and other scenarios. This change is available right now in the master branch of the GitHub repo. https://github.com/MindscapeHQ/raygun4net
One minor oddity is that the "--- End of stack trace from previous location where exception was thrown ---" messages will currently be formatted in your Raygun dashboard as though it is a normal stack trace line with unknown class and method names. I will fix this up like I did with the Xamarin.iOS stack traces in the near future.
Like last time, I'll keep this only in GitHub for initial testing before publishing to NuGet and the Xamarin store later. If you could please get version 2.0.2 from GitHub for now and check that the stack traces for your scenarios are improved, that would be a huge help.
Regards
-Jason Fauchelle
gshackles
Posted on
Apr 08 2014
Thanks for the quick turnaround on this, it definitely improves things. One thing I noticed is that the frames reported in the new version start with "undefined.undefined", which is not something I've seen in the iOS version. For example:
OloApiException: Please try this operation again or restart your application.
OloApiClient.Network.ResponseExtensions+<Process>c__async2`1[OloApiClient.Entities.OrderStatus].MoveNext():0
undefined.undefined in --- End of stack trace from previous location where exception was thrown ---:0
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw():0
System.Runtime.CompilerServices.TaskAwaiter`1[OloApiClient.Entities.OrderStatus].GetResult():0
AppCore.ViewModels.Checkout.PlaceOrderViewModelBase+<placeOrder>c__async2A.MoveNext():0
undefined.undefined in --- End of stack trace from previous location where exception was thrown ---:0
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw():0
System.Runtime.CompilerServices.TaskAwaiter.GetResult():0
AppCore.ViewModels.Base.ViewModelBase+<SafeOperation>c__async0.MoveNext():0
Jason Fauchelle
Raygun
Posted on
Apr 08 2014
Hello
I briefly mentioned this in my previous post, but did not explain it very clearly. I'll certainly be fixing this up for you before long. I just need to update the stack trace formatting for Xamarin.Android on the web app which will effect the display of all exceptions - new and existing.
Regards
-Jason Fauchelle