/// <summary>
/// Handles the Load event of the Page control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
protected void Page_Load( object sender, EventArgs e )
{
Exception ex = GetSavedValue( "RockLastException" ) as Exception;
if ( ex != null )
{
int? errorLevel = ( GetSavedValue( "RockExceptionOrder" ) ?? "" ).ToString().AsIntegerOrNull();
ClearSavedValue( "RockExceptionOrder" );
ClearSavedValue( "RockLastException" );
bool showDetails = errorLevel.HasValue && errorLevel.Value == 66;
if ( !showDetails )
{
try
{
// check to see if the user is an admin, if so allow them to view the error details
var userLogin = Rock.Model.UserLoginService.GetCurrentUser();
GroupService service = new GroupService( new RockContext() );
Group adminGroup = service.GetByGuid( new Guid( Rock.SystemGuid.Group.GROUP_ADMINISTRATORS ) );
showDetails = userLogin != null && adminGroup.Members.Where( m => m.PersonId == userLogin.PersonId ).Count() > 0;
}
catch { }
}
if ( showDetails )
{
lErrorInfo.Text = "<h3>Exception Log:</h3>";
ProcessException( ex, " " );
}
}
}