From e7921db3a448ab7b683f0932f8f7957ef2ec13ce Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 16 Aug 2024 19:07:38 +0800 Subject: [PATCH 1/2] Add Url to DocumentRenderErrorEvent --- .../Volo/Docs/Documents/DocumentRenderErrorEvent.cs | 2 ++ .../src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentRenderErrorEvent.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentRenderErrorEvent.cs index 2f30099576..19e7b01227 100644 --- a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentRenderErrorEvent.cs +++ b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentRenderErrorEvent.cs @@ -5,4 +5,6 @@ public class DocumentRenderErrorEvent public string Name { get; set; } public string ErrorMessage { get; set; } + + public string Url { get; set; } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index c80b81bf71..b3ec299de9 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -590,7 +590,9 @@ namespace Volo.Docs.Pages.Documents.Project Document.Content = $"````txt{Environment.NewLine}{message}{Environment.NewLine}````"; await LocalEventBus.PublishAsync(new DocumentRenderErrorEvent { - ErrorMessage = message, Name = Document.Name + ErrorMessage = e.Message, + Name = Document.Name, + Url = Request.GetDisplayUrl() }); // Slow down with crawling From ede0da863e6c98b4db88026083cce07c4b0ec02a Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 16 Aug 2024 20:29:45 +0800 Subject: [PATCH 2/2] Add UserPreferences to DocumentRenderErrorEvent --- .../Volo/Docs/Documents/DocumentRenderErrorEvent.cs | 4 ++++ .../src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentRenderErrorEvent.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentRenderErrorEvent.cs index 19e7b01227..f837c740e7 100644 --- a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentRenderErrorEvent.cs +++ b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentRenderErrorEvent.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; + namespace Volo.Docs.Documents; public class DocumentRenderErrorEvent @@ -7,4 +9,6 @@ public class DocumentRenderErrorEvent public string ErrorMessage { get; set; } public string Url { get; set; } + + public Dictionary UserPreferences { get; set; } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index b3ec299de9..970e967a98 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -592,7 +592,8 @@ namespace Volo.Docs.Pages.Documents.Project { ErrorMessage = e.Message, Name = Document.Name, - Url = Request.GetDisplayUrl() + Url = Request.GetDisplayUrl(), + UserPreferences = UserPreferences }); // Slow down with crawling