コード例 #1
0
        /// <summary>
        /// Create representation of Exception
        /// Inner exceptions are handled recursively
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        private Log4MongoException ExceptionToLog4MongoException(Exception ex)
        {
            var exception = new Log4MongoException();

            exception.Message    = ex.Message;
            exception.Source     = ex.Source;
            exception.StackTrace = ex.StackTrace;

            if (ex.InnerException != null)
            {
                exception.InnerException = ExceptionToLog4MongoException(ex.InnerException);
            }

            return(exception);
        }
コード例 #2
0
        /// <summary>
        /// Create representation of Exception
        /// Inner exceptions are handled recursively
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        private Log4MongoException ExceptionToLog4MongoException(Exception ex)
        {
            var exception = new Log4MongoException();
            exception.Message = ex.Message;
            exception.Source = ex.Source;
            exception.StackTrace = ex.StackTrace;

            if (ex.InnerException != null)
            {
                exception.InnerException = ExceptionToLog4MongoException(ex.InnerException);
            }

            return exception;
        }