Skip to content

Commit 10a6739

Browse files
authored
feat(ErrorLogger): do not show the exception info on DEBUG mode (#6075)
* refactor: 增加 Debug 模式逻辑 * refactor: 增加注释 * chore: bump version 9.6.4-beta06
1 parent 04bb996 commit 10a6739

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.6.4-beta05</Version>
4+
<Version>9.6.4-beta06</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/ErrorLogger/BootstrapBlazorErrorBoundary.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ protected override async Task OnErrorAsync(Exception exception)
6868
/// <param name="builder"></param>
6969
protected override void BuildRenderTree(RenderTreeBuilder builder)
7070
{
71+
#if DEBUG
72+
// DEBUG 模式下显示异常堆栈信息到 UI 页面方便开发人员调试
7173
if (OnErrorHandleAsync == null)
7274
{
7375
var ex = CurrentException ?? _exception;
@@ -77,6 +79,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder)
7779
builder.AddContent(0, ExceptionContent(ex));
7880
}
7981
}
82+
#endif
8083
builder.AddContent(1, ChildContent);
8184
}
8285

0 commit comments

Comments
 (0)