Exemple #1
0
 private async Task EditTemplateAsync()
 {
     try
     {
         await Button.SpinAsync(async() =>
         {
             await TemplateService.EditTemplateAsync(Template);
             await ToastService.ShowToastAsync("Template updated.", ToastType.Success);
             await ModalDialogClose();
         });
     }
     catch (AlreadyExistException ex)
     {
         ValidationErrorMessage.DisplayError(nameof(SharedAccount.Name), ex.Message);
     }
     catch (IncorrectUrlException ex)
     {
         ValidationErrorMessage.DisplayError(nameof(SharedAccount.Urls), ex.Message);
     }
     catch (Exception ex)
     {
         Logger.LogError(ex.Message, ex);
         await ToastService.ShowToastAsync(ex.Message, ToastType.Error);
         await ModalDialogCancel();
     }
 }