www.pudn.com > WorkFlowserver.rar > AppException.cs
using System;
using System.Diagnostics;
namespace WalkWatch.WebModules
{
///
///
///
public class AppException: System.Exception
{
public AppException()
{
LogEvent("An unexpected error occurred.");
}
public AppException(string message)
{
LogEvent(message);
}
public AppException(string message, Exception innerException)
{
LogEvent(message);
if (innerException != null)
{
LogEvent(innerException.Message);
}
}
private void LogEvent(string message)
{
if (!EventLog.SourceExists("WalkWatch.EPos.COM"))
{
EventLog.CreateEventSource("WalkWatch.EPos.COM", "Application");
}
EventLog.WriteEntry("WalkWatch.EPos.COM", message, EventLogEntryType.Error);
}
}
}