Beispiel #1
0
        private FaultExceptionDetails GetFaultExceptionDetails(Exception ex)
        {
            FaultExceptionDetails exceptionDetails = new FaultExceptionDetails();

            try
            {
                string[] faultErrorDetailsArr = System.Text.RegularExpressions.Regex.Split(ex.Message, faultExceptionMessageSplitter);
                if (faultErrorDetailsArr.Length == faultExceptionMessageArraylength)
                {
                    exceptionDetails.ExceptionType  = faultErrorDetailsArr[0];
                    exceptionDetails.Exception      = faultErrorDetailsArr[1];
                    exceptionDetails.InnerException = faultErrorDetailsArr[2];
                    exceptionDetails.StackTrace     = faultErrorDetailsArr[3];
                    exceptionDetails.DbEntityValidationException = faultErrorDetailsArr[4];
                }
            }
            catch
            {
                //Should not happen
                exceptionDetails.Exception = "Error in APIControllerBase GetFaultExceptionDetails";
            }

            return(exceptionDetails);
        }
Beispiel #2
0
        private FaultExceptionDetails GetExceptionDetails(Exception ex)
        {
            FaultExceptionDetails exceptionDetails = new FaultExceptionDetails();

            try
            {
                if (ex != null)
                {
                    exceptionDetails.ExceptionType = ex.GetType().ToString();
                    exceptionDetails.Exception     = ex.Message;
                    if (ex.InnerException != null)
                    {
                        exceptionDetails.InnerException = ex.InnerException.Message;
                    }
                    exceptionDetails.StackTrace = ex.StackTrace;
                }
            }
            catch
            {
                //Should not happen
                exceptionDetails.Exception = "Error in  APIControllerBase GetExceptionDetails";
            }
            return(exceptionDetails);
        }