Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

get SharePoint SPException details C#

$
0
0

Hi want to get detailed exception report on any exception I got and send email.

I have done everything Except I want Method name in which exception occurred, class name , file path, event name

using below code to generate exception (allowunsafeupdate false)

SPSecurity.RunWithElevatedPrivileges(delegate()
                            {
                                SPPermissionInfo info = oWeb.GetUserEffectivePermissionInfo(oWeb.CurrentUser.Name);
                                SPPrincipal userGroup = oWeb.CurrentUser;
                                SPRoleAssignment roleAssignment = new SPRoleAssignment(userGroup);
                                SPRoleDefinition roleDefination = oWeb.RoleDefinitions["Contribute"];
                                roleAssignment.RoleDefinitionBindings.Add(roleDefination);
                                l.RoleAssignments.Add(roleAssignment);
                                l.Update();
                            });

                    }
                    catch (SPException ex)
                    {
                        CustomError(ex, oWeb.CurrentUser.Name, "one@two.com");
                    }
I am getting below output

but I wants Method name, class name, event name, file path details anyhow using C#.

in stack track I am able to see details but I want in separate column.

any help appreciated



Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>