Example #1
0
        public static WinHttpException CreateExceptionUsingError(int error, string nameOfCalledFunction, Exception innerException)
        {
            var e = new WinHttpException(error, GetErrorMessage(error, nameOfCalledFunction), innerException);

            ExceptionStackTrace.AddCurrentStack(e);
            return(e);
        }
Example #2
0
        public static WinHttpException CreateExceptionUsingError(int error)
        {
            var e = new WinHttpException(error, GetErrorMessage(error));

            ExceptionStackTrace.AddCurrentStack(e);
            return(e);
        }
Example #3
0
        private void LogError(Exception exception)
        {
            if (testDatabase == null)
            {
                return;
            }

            ErrorLogEntry error = new ErrorLogEntry();

            var exceptionStackTrace = new ExceptionStackTrace(exception);

            error.CommandLine         = Environment.CommandLine;
            error.ExceptionMessage    = exceptionStackTrace.Message;
            error.ExceptionType       = exception.GetType().FullName;
            error.ExceptionSource     = exceptionStackTrace.Source;
            error.ExceptionStackTrace = exceptionStackTrace.StackTrace;
            error.FileName            = exceptionStackTrace.FileName;
            error.HostName            = System.Environment.MachineName;
            error.IPAddress           = Utils.GetLocalIP().GetAddressBytes();
            error.LineNumber          = exceptionStackTrace.LineNumber;
            error.ProcessID           = Process.GetCurrentProcess().Id;
            error.TestID = testDatabase.GetCurrentTestID();

            testDatabase.LogError(error);
        }