Yeah, weird stuff can happen. Specially with Microsoft stuff. I have seen very inconsistent behaviour with Azure!

However, if the response is XML, message will be a valid string and split('\n')[0] will work even if there is no '\n' in the string.

We can catch a generic exception while parsing