Skip to content

Bug report: wrong error format for commands #3750

@milanholemans

Description

@milanholemans

Description

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

image

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:

  • spo folder roleinheritance reset
  • spo file roleinheritance reset

Steps to reproduce

  1. 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions