Skip to content

Commit 12cd890

Browse files
authored
Merge branch 'main' into feat-file-icon
2 parents d3a54b9 + eaa9a8b commit 12cd890

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/BootstrapBlazor/Components/ErrorLogger/BootstrapBlazorErrorBoundary.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class BootstrapBlazorErrorBoundary : ErrorBoundaryBase
2626
[NotNull]
2727
private ToastService? ToastService { get; set; }
2828

29+
[Inject]
30+
[NotNull]
31+
private NavigationManager? NavigationManager { get; set; }
32+
2933
/// <summary>
3034
/// 获得/设置 自定义错误处理回调方法
3135
/// </summary>
@@ -65,7 +69,7 @@ protected override async Task OnErrorAsync(Exception exception)
6569
await ToastService.Error(ToastTitle, exception.Message);
6670
}
6771

68-
Logger.LogError(exception, "{BootstrapBlazorErrorBoundary} {OnErrorAsync} log this error", nameof(BootstrapBlazorErrorBoundary), nameof(OnErrorAsync));
72+
Logger.LogError(exception, "{BootstrapBlazorErrorBoundary} {OnErrorAsync} log this error occurred at {Page}", nameof(BootstrapBlazorErrorBoundary), nameof(OnErrorAsync), NavigationManager.Uri);
6973
}
7074
}
7175

0 commit comments

Comments
 (0)