File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/BootstrapBlazor/Components/ErrorLogger Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ public class ErrorLogger : ComponentBase, IErrorLogger
1818 [ NotNull ]
1919 private IStringLocalizer < ErrorLogger > ? Localizer { get ; set ; }
2020
21+ [ Inject ]
22+ [ NotNull ]
23+ private ILogger < ErrorLogger > ? Logger { get ; set ; }
24+
2125 /// <summary>
2226 /// <inheritdoc/>
2327 /// </summary>
@@ -101,7 +105,17 @@ protected override void BuildRenderTree(RenderTreeBuilder builder)
101105 /// </summary>
102106 /// <param name="exception"></param>
103107 /// <returns></returns>
104- public Task HandlerExceptionAsync ( Exception exception ) => _errorBoundary . RenderException ( exception , _cache . LastOrDefault ( ) ) ;
108+ public async Task HandlerExceptionAsync ( Exception exception )
109+ {
110+ if ( OnErrorHandleAsync != null )
111+ {
112+ await OnErrorHandleAsync ( Logger , exception ) ;
113+ }
114+ else
115+ {
116+ await _errorBoundary . RenderException ( exception , _cache . LastOrDefault ( ) ) ;
117+ }
118+ }
105119
106120 private readonly List < IHandlerException > _cache = [ ] ;
107121
You can’t perform that action at this time.
0 commit comments