// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.ComponentModel;
namespace EpicGames.Core
{
///
/// 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 => String.Format("{0} (code 0x{1:X8})", base.Message, NativeErrorCode);
}
}