2.2.1 Common Exceptions

The protocol server MUST validate the request from the protocol client and return the exception listed in the following table to the protocol client under the specified conditions.

Error Code

Error Type Name

Condition

-2130575251

Microsoft.SharePoint.SPException

The protocol server requires a form digest but the form digest in the X-RequestDigest HTTP header is not as same as the one generated by the protocol server.

-2130575252

Microsoft.SharePoint.Exception

The protocol client sent a valid form digest in the X-RequestDigest ([MS-WSSHP] section 2.2.11 and [MS-SITESS] section 3.1.4) HTTP header, but the form digest is expired.

-2146232832

Microsoft.SharePoint.SPException

The protocol server requires a form digest but the protocol client did not send an X-RequestDigest ([MS-WSSHP] section 2.2.11) HTTP header.

When a protocol server processes a CSOM operation in the request, the following table lists common exceptions that could occur when accessing or updating a property or invoking a method.

Error Code

Error Type Name

Condition

-2147024891

System.UnauthorizedAccessException

The user does not have permission to access a property, update a property or call a method.

Besides the preceding exceptions and the exceptions that are listed for the specific properties or methods, the protocol server can return other exceptions to the protocol client, for which the protocol client could use the error message for display purposes but could not use the error code or error type to determine the causes of the exception.

Unless specified, exceptions listed for the specific properties are thrown for both read and write operations.