Mindscape.Raygun4Net.RaygunClient.AddWrapperExceptions C# (CSharp) Method

AddWrapperExceptions() public method

Adds a list of outer exceptions that will be stripped, leaving only the valuable inner exception. This can be used when a wrapper exception, e.g. TargetInvocationException or AggregateException, contains the actual exception as the InnerException. The message and stack trace of the inner exception will then be used by Raygun for grouping and display. The above two do not need to be added manually, but if you have other wrapper exceptions that you want stripped you can pass them in here.
public AddWrapperExceptions ( ) : void
return void
        public void AddWrapperExceptions(params Type[] wrapperExceptions)
        {
            foreach (Type wrapper in wrapperExceptions)
              {
            if (!_wrapperExceptions.Contains(wrapper))
            {
              _wrapperExceptions.Add(wrapper);
            }
              }
        }

Usage Example

 public static RaygunClient GetClient()
 {
     var assemblyInfo = typeof(App).Assembly.GetAttribute<AssemblyInformationalVersionAttribute>();
     var client = new RaygunClient("uX5c/PiCVqF31xlEm3jShA==")
     {
         ApplicationVersion = assemblyInfo != null ? assemblyInfo.InformationalVersion : "Unknown Version"
     };
     client.AddWrapperExceptions(typeof(AggregateException));
     return client;
 }
All Usage Examples Of Mindscape.Raygun4Net.RaygunClient::AddWrapperExceptions