Dalamud/Dalamud.Bootstrap/Windows/ProcessException.cs
2020-03-29 13:38:48 +09:00

31 lines
1,007 B
C#

using System;
using System.ComponentModel;
namespace Dalamud.Bootstrap.Windows
{
/// <summary>
/// An exception that is thrown when there was an error while interacting with the process.
/// </summary>
internal sealed class ProcessException : Exception
{
public uint Pid { get; }
internal ProcessException() : base() { }
internal ProcessException(string message) : base(message) { }
internal ProcessException(string message, Exception innerException) : base(message, innerException) { }
internal ProcessException(string message, uint pid) : base(message) => Pid = pid;
internal ProcessException(string message, uint pid, Exception innerException) : base(message, innerException) => Pid = pid;
internal static void ThrowLastOsError(uint pid)
{
var inner = new Win32Exception();
const string message = "";
throw new ProcessException(message, pid, inner);
}
}
}