@inherits LayoutComponentBase @using AyCode.Interfaces.StorageHandlers; @using AyCode.Services.Loggers @using Newtonsoft.Json; @using TIAMSharedUI.Pages @using TIAMSharedUI.Shared.Components @using TIAMWebApp.Shared.Application.Interfaces @using TIAMWebApp.Shared.Application.Models.ClientSide; @using AyCode.Blazor.Components; @using TIAMWebApp.Shared.Application.Models; @using TIAMWebApp.Shared.Application.Utility; @using System.IdentityModel.Tokens.Jwt; @using TIAM.Core.Loggers; @inject NavigationManager NavManager @inject IJSRuntime jsRuntime @inject ISecureStorageHandler SecureStorageHandler @inject ISessionService sessionService @inject IEnumerable LogWriters
@Body
@* *@
@code { public PopupMessageBox PopupMessageBox { get; private set; } = default!; ILogger _logger; private void HandleError(Exception exception) { // Log the error to server LogErrorToServer(exception); // Show a notification on UI ShowErrorNotification("An unexpected error occurred. Please try again later."); jsRuntime.InvokeVoidAsync("console.error", $"An error occurred: {exception.Message}"); jsRuntime.InvokeVoidAsync("console.warn", $"Error details: {exception.StackTrace}"); _logger.Info($"An error occurred: {exception.Message}"); } private void LogErrorToServer(Exception exception) { //_logger.Error($"An error occurred: {exception.Message}"); } private void ShowErrorNotification(string message) { jsRuntime.InvokeVoidAsync("alert", message); } }