You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was writing code to update a listitem with await listItem.UpdateAsync(). Everything appeared to run fine, but the listitem in SharePoint was never updated. Using Fiddler I noticed that the response from SharePoint actually contained an error. Even though the response contained an error, the response code was actually 200 OK.
POST /sites/mysite/_api/web/lists/getbyid(guid'2089ed3d-88c9-4da4-bef5-f53cf1579c55')/items(57)/ValidateUpdateListItem HTTP/1.1
{
"ErrorCode":-2146232832,
"ErrorMessage":
"Enter a date like this: 2/23/2012",
"FieldName":"EdmDecEmploymentStartDate",
"FieldValue":"test",
"HasException":true,
"ItemId":57
}
Obviously this was my fault for submitting the wrong date format, but I would expect that PnP throw an error here since the call actually failed.
@rlv-dan : thanks for using PnP Core SDK and reporting this. Currently the response of the add call does check for possible exceptions, while update doesn't. I'll commit a fix for this in the coming days.
@rlv-dan : I've just pushed a change which will be part of the next nightly build. I'll close this issue now, but feel free re-open or create a new one in case the added functionality is not working for you.
Category
Describe the bug
I was writing code to update a listitem with
await listItem.UpdateAsync()
. Everything appeared to run fine, but the listitem in SharePoint was never updated. Using Fiddler I noticed that the response from SharePoint actually contained an error. Even though the response contained an error, the response code was actually 200 OK.POST /sites/mysite/_api/web/lists/getbyid(guid'2089ed3d-88c9-4da4-bef5-f53cf1579c55')/items(57)/ValidateUpdateListItem HTTP/1.1
Obviously this was my fault for submitting the wrong date format, but I would expect that PnP throw an error here since the call actually failed.
Environment details (development & target environment)
The text was updated successfully, but these errors were encountered: