Catching error on LoadPersistData

Hello

When I apply persist data to a pivot table it occasionally fails. For example, in the code below if you were to set json = "A nonsense string that will fail" then this will clearly throw an error.  However I am unable to catch the error with a try catch so the code below results in a page catch.  Is there a way to do this?

       try
        {
          await PivotView.LoadPersistData(json);
        }
        catch (Exception ex )
        {
          NotificationService.DisplayNotification("Load Report Error", ex.Message, 0, NotificationType.Error);
        }

Thanks

3 Replies 1 reply marked as answer

SS Saranya Sivan Syncfusion Team February 8, 2021 07:45 AM UTC

Hi Richard, 
Thanks for contacting Syncfusion support. 
We have checked the reported problem with given code snippets. But we are unable to reproduce the problem at our end. Meanwhile, we have prepared a sample for your reference. Please find the sample in the below link. 
  
Also, kindly share us the JSON information (persist data) as we mentioned in the below screen-shot. This would help us to investigate the reported problem at our end and provide the solution at earliest.  
  

 
  
  
Regards, 
Saranya Sivan. 
 


Marked as answer

DI Ditchford February 9, 2021 01:20 AM UTC

Hello

Thanks for that.  My question was more about whether it is possible to catch an error if one is encountered on the LoadPersistData.  In previous versions I could not use a try catch block to catch an error during the LoadPersistData.  I have just retested in the latest version (your sample) and it is now possible to catch such an error.  I can then reset the Pivot if an error is encountered.  So my problem no longer exists....thanks.

As a matter of interest has something changed on the Pivots that means the try catch block now catches this type of error?

Many Thanks


SS Saranya Sivan Syncfusion Team February 9, 2021 08:34 AM UTC

Hi Richard Grieveson, 
 
We have done some architectural changes in Blazor pivot table component on Vol 4, 2020 release (v18.4.0.30) to improve its performance and stability. These changes can now allow to use try catch option in sample. 
  
Please let us know if you have any other queries. We are always happy to assist you.   
 
Regards, 
Saranya. 
 


Loader.
Up arrow icon