public static CustomErrorSignal Get(HttpApplication application)
        {
            //if (application == null)
            //    throw new ArgumentNullException("application");
            application = application ?? new HttpApplication();
            lock (Lock)
            {
                //
                // Allocate map of object per application on demand.
                //

                if (_signalByApp == null)
                {
                    _signalByApp = new Hashtable();
                }

                //
                // Get the list of modules for the application. If this is
                // the first registration for the supplied application object
                // then setup a new and empty list.
                //

                var signal = (CustomErrorSignal)_signalByApp[application];

                if (signal == null)
                {
                    signal = new CustomErrorSignal();
                    _signalByApp.Add(application, signal);
                    application.Disposed += OnApplicationDisposed;
                }

                return(signal);
            }
        }
        /// <summary>
        /// Initializes the module and prepares it to handle requests.
        /// </summary>

        protected override void OnInit(HttpApplication application)
        {
            //if (application == null)
            //    throw new ArgumentNullException("application");
            application = application ?? new HttpApplication();


            application.Error += OnError;
            CustomErrorSignal.Get(application).Raised += OnCustomErrorSignaled;
        }