System.Configuration.ExceptionUtil.WrapAsConfigException C# (CSharp) Метод

WrapAsConfigException() статический приватный Метод

static private WrapAsConfigException ( string outerMessage, Exception e, IConfigErrorInfo errorInfo ) : ConfigurationErrorsException
outerMessage string
e System.Exception
errorInfo IConfigErrorInfo
Результат ConfigurationErrorsException
        static internal ConfigurationErrorsException WrapAsConfigException(string outerMessage, Exception e, IConfigErrorInfo errorInfo) {
            if (errorInfo != null) {
                return WrapAsConfigException(outerMessage, e, errorInfo.Filename, errorInfo.LineNumber);
            }
            else {
                return WrapAsConfigException(outerMessage, e, null, 0);
            }
        }

Same methods

ExceptionUtil::WrapAsConfigException ( string outerMessage, Exception e, string filename, int line ) : ConfigurationErrorsException

Usage Example

        public override XmlNode ProcessRawXml(XmlNode rawXml)
        {
            XmlNode processedXml       = rawXml;
            String  currentBuilderName = null;

            try {
                foreach (ConfigurationBuilder b in _builders)
                {
                    currentBuilderName = b.Name;
                    processedXml       = b.ProcessRawXml(processedXml);
                }
                return(processedXml);
            }
            catch (Exception e) {
                throw ExceptionUtil.WrapAsConfigException(SR.GetString(SR.ConfigBuilder_processXml_error_short,
                                                                       currentBuilderName), e, null);
            }
        }
All Usage Examples Of System.Configuration.ExceptionUtil::WrapAsConfigException