protected void RenderNavBarDetails() { base.Response.Write("<div class='diagBlock'>"); NavBarDiagnosticsDetails navBarDiagnosticsDetails = new NavBarDiagnosticsDetails(); HttpContext.Current.Cache["NavBarDiagnostics.Details"] = navBarDiagnosticsDetails; base.Write("Use the information below to troubleshoot problems and report issues to technical support."); base.Write("NavBar configuration information"); NavBarClientBase.RenderConfigInformation(base.Response.Output); Identity identity = (base.Request.QueryString["flight"] == "geminishellux") ? new Identity("myself", "myself") : new Identity("myorg", "myorg"); Exception ex = null; try { PowerShellResults <NavBarPack> @object = new NavBar().GetObject(identity); base.Write("NavBar data:", @object.HasValue ? @object.Output[0].ToJsonString(null) : null); } catch (Exception ex2) { ex = ex2; } finally { if (navBarDiagnosticsDetails.Exception != null) { base.Write("Exception:", navBarDiagnosticsDetails.Exception.ToString()); } if (ex != null) { base.Write("Additional Exception:", ex.ToString()); } base.Response.Write("</div>"); } }
protected bool LogException() { if (this.shellServiceException != null) { NavBarDiagnosticsDetails navBarDiagnosticsDetails = (NavBarDiagnosticsDetails)HttpContext.Current.Cache["NavBarDiagnostics.Details"]; if (navBarDiagnosticsDetails != null) { navBarDiagnosticsDetails.Exception = this.shellServiceException; } string nameForEventLog = this.rbacPrincipal.NameForEventLog; string text = this.shellServiceException.ToString(); ExTraceGlobals.WebServiceTracer.TraceError <string, string>(0, 0L, "NavBarHelper catch exception when try to connect to Shell Service. User: {0}. Exception: {1}.", nameForEventLog, text); EcpEventLogConstants.Tuple_Office365ShellServiceFailed.LogPeriodicEvent(EcpEventLogExtensions.GetPeriodicKeyPerUser(), new object[] { EcpEventLogExtensions.GetUserNameToLog(), text }); return(true); } return(false); }