module load error handler, router optimizaton, relative paths, fixed add existing module control panel issue

This commit is contained in:
Shaun Walker
2020-03-04 13:22:58 -05:00
parent 061043bd15
commit 4c2007439d
10 changed files with 242 additions and 199 deletions

View File

@ -0,0 +1,18 @@
@namespace Oqtane.Modules.Admin.Error
@inherits ModuleBase
@inject IModuleService ModuleService
@code {
public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Anonymous; } }
protected override async Task OnInitializedAsync()
{
Module module = await ModuleService.GetModuleAsync(ModuleState.ModuleId);
if (UserSecurity.IsAuthorized(PageState.User, Constants.HostRole))
{
string message = "A Problem Was Encountered Loading Module " + module.ModuleDefinitionName;
AddModuleMessage(message, MessageType.Error);
}
await logger.LogCritical("Error Loading Module {Module}", module);
}
}