Missing exception property on ServerStatusUpdateEventArgs

dhcp-server
Pat Hartl 2023-09-01 00:57:20 -05:00
parent 9f4e0b5fe3
commit 835a013bad
1 changed files with 7 additions and 1 deletions

View File

@ -37,12 +37,18 @@ namespace LANCommander.Services
{ {
public Server Server { get; private set; } public Server Server { get; private set; }
public ServerProcessStatus Status { get; private set; } public ServerProcessStatus Status { get; private set; }
public Exception Exception { get; private set; }
public ServerStatusUpdateEventArgs(Server server, ServerProcessStatus status) public ServerStatusUpdateEventArgs(Server server, ServerProcessStatus status)
{ {
Server = server; Server = server;
Status = status; Status = status;
} }
public ServerStatusUpdateEventArgs(Server server, ServerProcessStatus status, Exception exception) : this(server, status)
{
Exception = exception;
}
} }
public class LogFileMonitor : IDisposable public class LogFileMonitor : IDisposable
@ -197,7 +203,7 @@ namespace LANCommander.Services
} }
catch (Exception ex) catch (Exception ex)
{ {
OnStatusUpdate?.Invoke(this, new ServerStatusUpdateEventArgs(server, ServerProcessStatus.Error)); OnStatusUpdate?.Invoke(this, new ServerStatusUpdateEventArgs(server, ServerProcessStatus.Error, ex));
Logger.Error(ex, "Could not start server process"); Logger.Error(ex, "Could not start server process");
} }