{"action":"created","issue":{"url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/274","repository_url":"https://api.github.com/repos/SharePoint/PnP-JS-Core","labels_url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/274/comments","events_url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/274/events","html_url":"https://github.com/SharePoint/PnP-JS-Core/issues/274","id":196720600,"number":274,"title":"Cannot retrieve error info after an invalid request is made","user":{"login":"russgove","id":2412956,"avatar_url":"https://avatars.githubusercontent.com/u/2412956?v=3","gravatar_id":"","url":"https://api.github.com/users/russgove","html_url":"https://github.com/russgove","followers_url":"https://api.github.com/users/russgove/followers","following_url":"https://api.github.com/users/russgove/following{/other_user}","gists_url":"https://api.github.com/users/russgove/gists{/gist_id}","starred_url":"https://api.github.com/users/russgove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russgove/subscriptions","organizations_url":"https://api.github.com/users/russgove/orgs","repos_url":"https://api.github.com/users/russgove/repos","events_url":"https://api.github.com/users/russgove/events{/privacy}","received_events_url":"https://api.github.com/users/russgove/received_events","type":"User","site_admin":false},"labels":[{"id":336234980,"url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/labels/duplicate","name":"duplicate","color":"cccccc","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-12-20T16:41:17Z","updated_at":"2016-12-26T08:00:25Z","closed_at":null,"body":"Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your\r\nneeds please complete the below template to ensure we have the details to help. Thanks!\r\n\r\n#### Category\r\n[x] Enhancement\r\n\r\n[ ] Bug\r\n\r\n[ x] Question\r\n\r\nI have code that lets the user enter the fields he wats to select from a list, and then retrives the data and shows it.  the code is as follows\r\n        const promise = web.lists.getById(listid).items.select(fieldnames.concat(\"GUID\").concat(\"Id\").join(\",\")).get()\r\n            .then((response) => {\r\n\r\n                const data = _.map(response, (item: any) => {\r\n                    item.__metadata__ListDefinitionId = listDefinition.guid; // save my listdef, so i can get the columnReferences later\r\n                    return item;\r\n                });\r\n                console.log(data);\r\n                const gotListItems = gotListItemsAction(data);\r\n                dispatch(gotListItems); // need to ewname this one to be digfferent from the omported ome\r\n            })\r\n            .catch((error) => {\r\n                console.log(error);\r\n                dispatch(getListItemsErrorAction(error)); // need to ewname this one to be digfferent from the omported ome\r\n            });\r\n        promises.push(promise);\r\n\r\n\r\nIf the user selects an invalid field name I end up in the catch block. The errror  object in the catch block looks like this\r\naction.payload.error\r\nTypeError: Already read\r\n    at ODataDefaultParser.ODataParserBase.parse (odata.js:33)\r\n    at Items.Queryable.processHttpClientResponse (queryable.js:309)\r\n    at queryable.js:242\r\n\r\nThe request that got sent to the server was\r\nhttps://xxxx.sharepoint.com/sites/issues/Ussuessite1/_api/web/lists('e06e5b0c-4734-487a-867c-9973e5e915f9')/items?$select=Title,_UIVersionString,GUID,Id\r\n\r\nand the response received was \r\nHTTP/1.1 400 Bad Request\r\nCache-Control: private, max-age=0\r\nTransfer-Encoding: chunked\r\nContent-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8\r\nExpires: Mon, 05 Dec 2016 15:19:57 GMT\r\nLast-Modified: Tue, 20 Dec 2016 15:19:57 GMT\r\nServer: Microsoft-IIS/8.5\r\n\r\nX-SharePointHealthScore: 0\r\nX-SP-SERVERSTATE: ReadOnly=0\r\nDATASERVICEVERSION: 3.0\r\nSPClientServiceRequestDuration: 38\r\nSPRequestDuration: 294\r\nX-AspNet-Version: 4.0.30319\r\nSPRequestGuid: e2efc29d-f0af-3000-d0ff-95171178acb7\r\nrequest-id: e2efc29d-f0af-3000-d0ff-95171178acb7\r\nStrict-Transport-Security: max-age=31536000\r\nX-FRAME-OPTIONS: SAMEORIGIN\r\nX-Powered-By: ASP.NET\r\nMicrosoftSharePointTeamServices: 16.0.0.6008\r\nX-Content-Type-Options: nosniff\r\nX-MS-InvokeApp: 1; RequireReadOnly\r\nP3P: CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"\r\nDate: Tue, 20 Dec 2016 15:19:57 GMT\r\n\r\n9d\r\n{\"odata.error\":{\"code\":\"-1, Microsoft.SharePoint.SPException\",\"message\":{\"lang\":\"en-US\",\"value\":\"The field or property '_UIVersionString' does not exist.\"}}}\r\n0\r\n\r\n\r\nI  need to be able to capture the error tect \"The field or property '_UIVersionString' does not exist.\" so othat I can display it to the user.\r\n\r\nI traced it through and it looks like Queryable.prototype.processHttpClientResponse  calls parser.parse(response); and that does not return the values properly.\r\n\r\nI think it might be because a few lines up in processHttpClientResponse we are calling response.text() to get the error message and log it, and the message cannot be read twice from the fetch client.\r\n"},"comment":{"url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/comments/269180058","html_url":"https://github.com/SharePoint/PnP-JS-Core/issues/274#issuecomment-269180058","issue_url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/274","id":269180058,"user":{"login":"tavikukko","id":2223355,"avatar_url":"https://avatars.githubusercontent.com/u/2223355?v=3","gravatar_id":"","url":"https://api.github.com/users/tavikukko","html_url":"https://github.com/tavikukko","followers_url":"https://api.github.com/users/tavikukko/followers","following_url":"https://api.github.com/users/tavikukko/following{/other_user}","gists_url":"https://api.github.com/users/tavikukko/gists{/gist_id}","starred_url":"https://api.github.com/users/tavikukko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tavikukko/subscriptions","organizations_url":"https://api.github.com/users/tavikukko/orgs","repos_url":"https://api.github.com/users/tavikukko/repos","events_url":"https://api.github.com/users/tavikukko/events{/privacy}","received_events_url":"https://api.github.com/users/tavikukko/received_events","type":"User","site_admin":false},"created_at":"2016-12-26T08:00:25Z","updated_at":"2016-12-26T08:00:25Z","body":"Upgraded node to 6.9.1 but still some type errors\r\n\r\n**src/net/digestcache.ts(40,42):** error TS2339: Property 'FormDigestValue' does not exist on type 'Response'.\r\n**src/net/digestcache.ts(41,32):** error TS2339: Property 'FormDigestTimeoutSeconds' does not exist on type 'Response'.\r\n**src/net/nodefetchclient.ts(55,16):** error TS2322: Type 'Promise<string>' is not assignable to type 'Promise<AuthToken>'.\r\n  Type 'string' is not assignable to type 'AuthToken'.\r\n**src/sharepoint/items.ts(177,16):** error TS2322: Type 'Promise<{ ListItemEntityTypeFullName: string; }>' is not assignable to type 'Promise<ItemUpdateResult>'.\r\n  Type '{ ListItemEntityTypeFullName: string; }' is not assignable to type 'ItemUpdateResult'.\r\n    Property 'item' is missing in type '{ ListItemEntityTypeFullName: string; }'.\r\n**src/sharepoint/userprofiles.ts(166,16):** error TS2322: Type 'Promise<ArrayBuffer>' is not assignable to type 'Promise<void>'.\r\n  Type 'ArrayBuffer' is not assignable to type 'void'.\r\n"}}
{"actor":{"display_login":"tavikukko"}}