-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExecuteAsync(throwOnError:false) is ignored #741
Comments
…code that processed the list item response #741
Thanks for reporting this @kohsel , this was indeed an issue. I've pushed a fix for this, please try again with tomorrow's nightly build and report back. |
Hi again I've included the code thats not behaving as described in the PnP Core documentation:
Please let me know if you need further information. Best regards |
Let me verify things @kohsel , in your scenario you're using a named batch while I tested with the default implicit batch. If you could step over the code in your app (see https://pnp.github.io/pnpcore/using-the-sdk/basics-debug.html) that would also help here. |
@kohsel : nevermind, using a custom batch I can simulate the issue. |
@kohsel : an improved fix was committed, this one also correctly handles the case where one uses a named batch. Can you test again with the next nightly (so tomorrow) and provide feedback. |
@kohsel : think this now works given there's no further feedback. If not then please re-open this issue or create a new one. |
@jansenbe with the latest nightly-build I no longer get the exception. However I am a bit surprised on the batchResult returned. I submit a batch of 11 creates where one is a violating duplicate. In the batchResult I get 1 item, which I have dumped below. Apparently only the error results are returned, but I find it strange that the StatusCode is OK. Is this because the statusCode is actually the HTTP status code? Then I would imagine that the variable should be a the batchresult collection and not on the Items, since there is only one HTTP request - or is there more? I also find it a bit strange that in the API response object the ErrorCode is 0, but the error message clearly states that the action did not succeed: { but I guess this is the raw response from the REST api? BatchResult { |
@kohsel : that's correct, we return what's provided by the REST call |
Hello
I am rather new to pnp core SDK, so please bear with me.
I have a SharePoint list where I have enabled EnforceUniqueValues on a field.
If I try to save a duplicate in a batch execution the context.ExecuteAsync(false) is ignoring the throwOnError = false and throws a SharePointRestServiceException instead of returning a List
It looks like it is in the PnP.Core.Model.SharePoint.ListItem constructor:
The text was updated successfully, but these errors were encountered: