private async Task CreateAccountAsync() { try { await ButtonSpinner.SpinAsync(async() => { await SharedAccountService.CreateSharedAccountAsync(SharedAccount); await ToastService.ShowToastAsync("Account created.", ToastType.Success); await SynchronizationService.UpdateSharedAccounts(ExceptPageId); await ModalDialogService.CloseAsync(); }); } catch (AlreadyExistException ex) { ValidationErrorMessage.DisplayError(nameof(SharedAccount.Name), ex.Message); } catch (IncorrectUrlException ex) { ValidationErrorMessage.DisplayError(nameof(SharedAccount.Urls), ex.Message); } catch (IncorrectOtpException ex) { ValidationErrorMessage.DisplayError(nameof(SharedAccount.OtpSecret), ex.Message); } catch (Exception ex) { Logger.LogError(ex.Message); await ToastService.ShowToastAsync(ex.Message, ToastType.Error); await ModalDialogService.CloseAsync(); } }