Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.8] [ML] Reverting use of isPopulatedObject in error utils (#159913) (
#159923) # Backport This will backport the following commits from `main` to `8.8`: - [[ML] Reverting use of isPopulatedObject in error utils (#159913)](#159913) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"James Gowdy","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-19T12:52:11Z","message":"[ML] Reverting use of isPopulatedObject in error utils (#159913)\n\nPR #155372 moved our error utils\r\nto a package and also made a few small code changes, one of which added\r\n`isPopulatedObject` to the error object type guards.\r\n`isPopulatedObject` uses `Object.keys` under the hood which cannot be\r\nused to access the non-enumerable properties of an object, like Error's\r\n`message`.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/6a0269df-ca2a-494a-9364-8f35f2b52388)\r\n\r\nThis PR reverts all of these functions back to their original versions\r\nwhich had existed in ML for a while without issue.\r\n\r\nThis was change had been causing error messages to not display\r\ncorrectly.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/1862f069-1626-4ac3-8961-dca016b91956)\r\n\r\nvs\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/243143a5-0c8f-4365-a41d-7c1c09858ad8)","sha":"8ca1789faa899f2e0a7abcf58fac50fa4d552af6","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","v8.9.0","v8.8.2"],"number":159913,"url":"https://github.com/elastic/kibana/pull/159913","mergeCommit":{"message":"[ML] Reverting use of isPopulatedObject in error utils (#159913)\n\nPR #155372 moved our error utils\r\nto a package and also made a few small code changes, one of which added\r\n`isPopulatedObject` to the error object type guards.\r\n`isPopulatedObject` uses `Object.keys` under the hood which cannot be\r\nused to access the non-enumerable properties of an object, like Error's\r\n`message`.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/6a0269df-ca2a-494a-9364-8f35f2b52388)\r\n\r\nThis PR reverts all of these functions back to their original versions\r\nwhich had existed in ML for a while without issue.\r\n\r\nThis was change had been causing error messages to not display\r\ncorrectly.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/1862f069-1626-4ac3-8961-dca016b91956)\r\n\r\nvs\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/243143a5-0c8f-4365-a41d-7c1c09858ad8)","sha":"8ca1789faa899f2e0a7abcf58fac50fa4d552af6"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159913","number":159913,"mergeCommit":{"message":"[ML] Reverting use of isPopulatedObject in error utils (#159913)\n\nPR #155372 moved our error utils\r\nto a package and also made a few small code changes, one of which added\r\n`isPopulatedObject` to the error object type guards.\r\n`isPopulatedObject` uses `Object.keys` under the hood which cannot be\r\nused to access the non-enumerable properties of an object, like Error's\r\n`message`.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/6a0269df-ca2a-494a-9364-8f35f2b52388)\r\n\r\nThis PR reverts all of these functions back to their original versions\r\nwhich had existed in ML for a while without issue.\r\n\r\nThis was change had been causing error messages to not display\r\ncorrectly.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/1862f069-1626-4ac3-8961-dca016b91956)\r\n\r\nvs\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/243143a5-0c8f-4365-a41d-7c1c09858ad8)","sha":"8ca1789faa899f2e0a7abcf58fac50fa4d552af6"}},{"branch":"8.8","label":"v8.8.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: James Gowdy <[email protected]>
- Loading branch information