Files
UnrealEngineUWP/Engine/Source/Programs/DotNETCommon/DotNETUtilities/Win32ExceptionWithCode.cs
ben marsh 69d578b959 UBT: Add unique error messages for every site that can throw an exception when creating managed processes. Also retry creating a process if it fails with ERROR_ACCESS_DENIED, which we seem to be seeing intermittently on the builders.
#ROBOMERGE-SOURCE: CL 9420558 via CL 9420568 via CL 9420572 via CL 9420589 via CL 9422358
#ROBOMERGE-BOT: (v480-9420520)

[CL 9422426 by ben marsh in Main branch]
2019-10-04 16:19:09 -04:00

52 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tools.DotNETCommon
{
/// <summary>
/// Wrapper for Win32Exception which includes the error code in the exception message
/// </summary>
class Win32ExceptionWithCode : Win32Exception
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="Code">The Windows error code</param>
public Win32ExceptionWithCode(int Code)
: base(Code)
{
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="Message">Message to display</param>
public Win32ExceptionWithCode(string Message)
: base(Message)
{
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="Code">The Windows error code</param>
/// <param name="Message">Message to display</param>
public Win32ExceptionWithCode(int Code, string Message)
: base(Code, Message)
{
}
/// <summary>
/// Returns the exception message. Overriden to include the error code in the message.
/// </summary>
public override string Message
{
get { return String.Format("{0} (code 0x{1:X8})", base.Message, base.NativeErrorCode); }
}
}
}