-
-
Notifications
You must be signed in to change notification settings - Fork 375
chore(Hosting): remove Microsoft.Extensions.Hosting.Abstractions deps #7492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,6 @@ | |||||
|
|
||||||
| using Microsoft.AspNetCore.Components.Rendering; | ||||||
| using Microsoft.Extensions.Configuration; | ||||||
| using Microsoft.Extensions.Hosting; | ||||||
| using Microsoft.Extensions.Logging; | ||||||
| using System.Reflection; | ||||||
|
|
||||||
|
|
@@ -32,10 +31,6 @@ class BootstrapBlazorErrorBoundary : ErrorBoundaryBase | |||||
| [NotNull] | ||||||
| private NavigationManager? NavigationManager { get; set; } | ||||||
|
|
||||||
| [Inject] | ||||||
| [NotNull] | ||||||
| private IHostEnvironment? HostEnvironment { get; set; } | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// 获得/设置 自定义错误处理回调方法 | ||||||
| /// </summary> | ||||||
|
|
@@ -161,16 +156,8 @@ public async Task RenderException(Exception exception, IHandlerException? handle | |||||
|
|
||||||
| if (handler != null) | ||||||
| { | ||||||
| if (HostEnvironment.IsDevelopment()) | ||||||
| { | ||||||
| // IHandlerException 处理异常逻辑 | ||||||
| await handler.HandlerExceptionAsync(exception, ExceptionContent); | ||||||
| } | ||||||
| else | ||||||
| { | ||||||
| // 非开发模式下弹窗提示错误信息 | ||||||
| await ToastService.Error(ToastTitle, exception.Message); | ||||||
| } | ||||||
| // 非开发模式下弹窗提示错误信息 | ||||||
|
||||||
| // 非开发模式下弹窗提示错误信息 | |
| // 弹窗提示错误信息 |
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change removes important error handling behavior. Previously, when a handler was provided and the application was in Development mode, the code would call handler.HandlerExceptionAsync() to render detailed error content in the UI. This functionality is now completely removed, meaning components implementing IHandlerException (like Layout and ModalDialog) will no longer be able to display detailed error information through their custom error handlers. Instead, only a simple toast message is shown regardless of the environment. This appears to be an unintended breaking change that could significantly impact debugging and error handling in development environments. Consider preserving the ability to call handler.HandlerExceptionAsync() without depending on IHostEnvironment, perhaps by always calling it or adding a configuration option.