// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved. using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tools.DotNETCommon { /// /// Wrapper for Win32Exception which includes the error code in the exception message /// class Win32ExceptionWithCode : Win32Exception { /// /// Constructor /// /// The Windows error code public Win32ExceptionWithCode(int Code) : base(Code) { } /// /// Constructor /// /// Message to display public Win32ExceptionWithCode(string Message) : base(Message) { } /// /// Constructor /// /// The Windows error code /// Message to display public Win32ExceptionWithCode(int Code, string Message) : base(Code, Message) { } /// /// Returns the exception message. Overriden to include the error code in the message. /// public override string Message { get { return String.Format("{0} (code 0x{1:X8})", base.Message, base.NativeErrorCode); } } } }