Browse Source
Show error instead of return 500 for Widget rendering
pull/17903/head
Enis Necipoglu
3 years ago
No known key found for this signature in database
GPG Key ID: 1EC55E13241E1680
1 changed files with
15 additions and
1 deletions
-
modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentFragment.cshtml
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
@using Microsoft.AspNetCore.Mvc.ViewComponents |
|
|
|
@using Microsoft.Extensions.Logging |
|
|
|
@using Volo.Abp.Data |
|
|
|
@using Volo.Abp.Reflection |
|
|
|
@using Volo.CmsKit.Contents |
|
|
|
@ -9,6 +10,7 @@ |
|
|
|
|
|
|
|
@inject IMarkdownToHtmlRenderer MarkdownRenderer |
|
|
|
@inject IViewComponentSelector ViewComponentSelector |
|
|
|
@inject ILogger<ContentFragmentViewComponent> Logger |
|
|
|
|
|
|
|
@foreach (var contentFragment in Model.ContentDto.ContentFragments) |
|
|
|
{ |
|
|
|
@ -35,6 +37,18 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@await Component.InvokeAsync(componentName, parameters) |
|
|
|
@try |
|
|
|
{ |
|
|
|
await Component.InvokeAsync(componentName, parameters); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
<div class="alert alert-danger alert-dismissible fade show" role="alert"> |
|
|
|
|
|
|
|
This part of content couldn't be loaded. |
|
|
|
</div> |
|
|
|
|
|
|
|
Logger.LogWarning(ex, $"Couldn't load the widget: {componentName}"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |