SPException error codes and values ​​(updating a form request request through SharePoint REST services)

Where can I find a list of error codes and their meaning for SharePoint exceptions? I can not find any list on the Internet, as well as specific cases here and there.

My particular need arises from the following scenario:

  • REST Services for SharePoint 2013
  • Update form request digest

I found that if my form request digest expires, I will get:

{ "error": { "code": "-2130575252, Microsoft.SharePoint.SPException", "message": { "lang": "en-US", "value": "The security validation for this page is invalid and might be corrupted. Please use your web browser Back button to try your operation again." } } 

Great, I can just find the error code -2130575252, update my request digest and try it again, right? Well, maybe ... I was left wondering in what other scenario can this error code be used? What other error codes might indicate a similar situation? With a little documentation on the error code, I felt more confident that this was the only error that an outdated request would produce. Alas, where is the documentation?

+5
source share
1 answer

I have yet to find an exhaustive list, there was no information about the error codes discussed at SPC2014 that I remember.

However, you are unlikely to need a link. Besides this crazy code, SP basically provides good error descriptions in the error object (for example: "The column User_x0020_Name does not exist."

In this case, I just catch the exception, check the exception code (parsing response with JSON.parse), update the page form overflow token, and then resubmit the AJAX request so that the user does not interfere.

Security Token Update (default timeout is 30 minutes):

UpdateFormDigest(_spPageContextInfo.webServerRelativeUrl, _spFormDigestRefreshInterval);

-1
source

Source: https://habr.com/ru/post/1201440/


All Articles