private static void ReadErrorHandler(XmlNode node, IRewriterConfiguration config)
        {
            string code = node.GetRequiredAttribute(Constants.AttrCode);

            XmlNode typeNode = node.Attributes[Constants.AttrType];
            XmlNode urlNode = node.Attributes[Constants.AttrUrl];
            if (typeNode == null && urlNode == null)
            {
                throw new ConfigurationErrorsException(MessageProvider.FormatString(Message.AttributeRequired, Constants.AttrUrl), node);
            }

            IRewriteErrorHandler handler = null;
            if (typeNode != null)
            {
                // <error-handler code="500" url="/oops.aspx" />
                handler = TypeHelper.Activate(typeNode.Value, null) as IRewriteErrorHandler;
                if (handler == null)
                {
                    throw new ConfigurationErrorsException(MessageProvider.FormatString(Message.InvalidTypeSpecified, typeNode.Value, typeof(IRewriteErrorHandler)), node);
                }
            }
            else
            {
                handler = new DefaultErrorHandler(urlNode.Value);
            }

            int statusCode;
            if (!Int32.TryParse(code, out statusCode))
            {
                throw new ConfigurationErrorsException(MessageProvider.FormatString(Message.InvalidHttpStatusCode, code), node);
            }

            config.ErrorHandlers.Add(statusCode, handler);
        }
        private static void ReadErrorHandler(XmlNode node, RewriterConfiguration config)
		{
			XmlNode codeNode = node.Attributes[Constants.AttrCode];
			if (codeNode == null)
			{
                throw new ConfigurationErrorsException(MessageProvider.FormatString(Message.AttributeRequired, Constants.AttrCode), node);
			}

			XmlNode typeNode = node.Attributes[Constants.AttrType];
			XmlNode urlNode = node.Attributes[Constants.AttrUrl];
			if (typeNode == null && urlNode == null)
			{
                throw new ConfigurationErrorsException(MessageProvider.FormatString(Message.AttributeRequired, Constants.AttrUrl), node);
			}

			IRewriteErrorHandler handler = null;
			if (typeNode != null)
			{
				// <error-handler code="500" url="/oops.aspx" />
				handler = TypeHelper.Activate(typeNode.Value, null) as IRewriteErrorHandler;
				if (handler == null)
				{
                    throw new ConfigurationErrorsException(MessageProvider.FormatString(Message.InvalidTypeSpecified));
				}
			}
			else
			{
				handler = new DefaultErrorHandler(urlNode.Value);
			}

			config.ErrorHandlers.Add(Convert.ToInt32(codeNode.Value), handler);
		}