oqtane.framework/Oqtane.Client/Modules/Admin/Error/Index.razor

19 lines
702 B
Plaintext

@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);
}
}