What the response message format will return

Hi all,
I have a problem in Nextcloud when i call api below,normaly, Nextcloud wil respones XML but some time not XML so i got error when parsing
so, the question is what the response message format will return when getting error from NC.
Thanks
API:
GET /ocs/v1.php/cloud/groups?search=abc