HttpInterceptor for DataManager calls?

I'm trying to implement a global solution for unhandled exceptions. As part of that solution, I've created a class that implements HttpInterceptor in hopes of providing information about failed DataManager http requests. In my case I'm using the ODataV4Adaptor.

My HttpInterceptor correctly deals with HttpClient calls from my application. However, it doesn't capture any DataManager calls, either manual calls (i.e. DataManager.executeQuery()) or via controls like the grid. My solution follows this rollbar example:


Is there better way to capture/intercept DataManager calls on a global level?

Thanks for your help!

-k

3 Replies 1 reply marked as answer

MS Manivel Sellamuthu Syncfusion Team October 5, 2020 10:29 AM UTC

Hi Kelly, 

Greetings from Syncfusion support. 

Based on your query we found that you want to intercept failed DataManager  requests and show the details to the user.  

To achieve your requirement we suggest you to use the actionFailure event of the Grid for your requirement. Please refer the below documentation links for more information. 


Please let us know, if you need further assistance. 

Regards, 
Manivel


KH Kelly Harrison October 5, 2020 01:44 PM UTC

Did you not see the fact that I'm trying to implement a GLOBAL solution?  Or that I said I'm using DataManager.executeQuery() and not just a grid?

I appreciate the fact that you typically respond to all posts (eventually) but sometimes I get the feeling you don't read them very carefully.


MS Manivel Sellamuthu Syncfusion Team October 6, 2020 02:46 PM UTC

Hi Kelly, 
 
Sorry for the inconvenience caused. 
 
Based on your requirement we suggest you to use a Custom Adaptor extending from ODataV4. So, we can override the processResponse method of the adaptor which process the data once request succeeded. Please refer the below documentation link for more information. 
 
 
To interrupt, the requests for manual calls like executeQuery method of the DataManager, we suggest you to bind the optional methods for success or failure along with the executeQuery method. Please refer the below documentation link for more information. 
 
 
Please let us know, if you need further assistance. 
 
Regards, 
Manivel 


Marked as answer
Loader.
Up arrow icon