Description
When running the command spo folder roleinheritance reset with wrong parameters, the displayed error is in XML.

The problem can be fixed by editing this line:
|
accept: 'application/json;odata.metadata=none' |
Instead we should use accept: 'application/json'.
This issue is happening for the following commands:
Steps to reproduce
- Run the command
spo folder roleinheritance reset with a wrong folderUrl f.e. --folderUrl "DoesntExist/FolderName"
Expected results
Instead of the entire XML, we should see only the error message itself so: The object specified does not belong to a list.
Actual results
<?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code>-2113929210, Microsoft.SharePoint.SPException</m:code><m:message xml:lang="en-US">The object specified does not belong to a list.</m:message></m:error>
Diagnostics
No response
CLI for Microsoft 365 version
v5.9.0
nodejs version
v16.13.2
Operating system (environment)
Windows
Shell
PowerShell
cli doctor
No response
Additional Info
No response
Description
When running the command
spo folder roleinheritance resetwith wrong parameters, the displayed error is in XML.The problem can be fixed by editing this line:
cli-microsoft365/src/m365/spo/commands/folder/folder-roleinheritance-reset.ts
Line 71 in 4b19747
Instead we should use
accept: 'application/json'.This issue is happening for the following commands:
Steps to reproduce
spo folder roleinheritance resetwith a wrongfolderUrlf.e.--folderUrl "DoesntExist/FolderName"Expected results
Instead of the entire XML, we should see only the error message itself so:
The object specified does not belong to a list.Actual results
Diagnostics
No response
CLI for Microsoft 365 version
v5.9.0
nodejs version
v16.13.2
Operating system (environment)
Windows
Shell
PowerShell
cli doctor
No response
Additional Info
No response