Switch to using notifications for errors
parent
685f7bf91d
commit
688979f283
|
@ -1,6 +1,7 @@
|
|||
@inject ServerService ServerService
|
||||
@inject ServerProcessService ServerProcessService
|
||||
@inject IMessageService MessageService
|
||||
@inject INotificationService NotificationService
|
||||
@implements IAsyncDisposable
|
||||
|
||||
<Space Size="@("large")">
|
||||
|
@ -84,21 +85,19 @@
|
|||
|
||||
if (Status == ServerProcessStatus.Error)
|
||||
{
|
||||
MessageService.Error("There was an unexpected error while trying to start the server.");
|
||||
NotificationService.Error(new NotificationConfig
|
||||
{
|
||||
Message = $"Error starting server {args.Server.Name}",
|
||||
Description = args.Exception.Message,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task Start()
|
||||
{
|
||||
try
|
||||
{
|
||||
await ServerProcessService.StartServerAsync(Server);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await MessageService.Error("There was an unexpected error while trying to start the server.");
|
||||
}
|
||||
ServerProcessService.StartServerAsync(Server);
|
||||
}
|
||||
|
||||
private void Stop()
|
||||
|
|
Loading…
Reference in New Issue