Browse Source

Merge pull request #20543 from abpframework/docpatch

Add Url to DocumentRenderErrorEvent
dgnyldrm7-patch-1
Gizem Mutu Kurt 2 years ago
committed by GitHub
parent
commit
e47608130e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentRenderErrorEvent.cs
  2. 5
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs

6
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
@ -5,4 +7,8 @@ public class DocumentRenderErrorEvent
public string Name { get; set; }
public string ErrorMessage { get; set; }
public string Url { get; set; }
public Dictionary<string, string> UserPreferences { get; set; }
}

5
modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs

@ -590,7 +590,10 @@ 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(),
UserPreferences = UserPreferences
});
// Slow down with crawling

Loading…
Cancel
Save