protected override async Task OnInitializedAsync() { try { Post = await PostLogic.GetPostAsync(Id); } catch (FormatException e) { Logger.LogWarning(e, e.Message); NavigationManager.NavigateTo("/Error"); } catch (Exception e) { Logger.LogError(e, e.Message); NavigationManager.NavigateTo("/Error"); } await base.OnInitializedAsync(); }