mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-22 20:42:24 +00:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using Lantean.QBTMudBlade.Components.Dialogs;
|
|
using Microsoft.AspNetCore.Components;
|
|
using MudBlazor;
|
|
|
|
namespace Lantean.QBTMudBlade.Components
|
|
{
|
|
public partial class ErrorDisplay
|
|
{
|
|
[Inject]
|
|
protected IDialogService DialogService { get; set; } = default!;
|
|
|
|
[Parameter]
|
|
[EditorRequired]
|
|
public EnhancedErrorBoundary ErrorBoundary { get; set; } = default!;
|
|
|
|
protected IEnumerable<Exception> Errors => ErrorBoundary.Errors;
|
|
|
|
protected async Task ShowException(Exception exception)
|
|
{
|
|
var parameters = new DialogParameters
|
|
{
|
|
{ nameof(ExceptionDialog.Exception), exception }
|
|
};
|
|
|
|
await DialogService.ShowAsync<ExceptionDialog>("Error Details", parameters, DialogHelper.FormDialogOptions);
|
|
}
|
|
|
|
protected async Task ClearErrors()
|
|
{
|
|
await ErrorBoundary.ClearErrors();
|
|
}
|
|
|
|
protected async Task ClearErrorsAndResumeAsync()
|
|
{
|
|
await ErrorBoundary.RecoverAndClearErrors();
|
|
}
|
|
}
|
|
} |