Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

RESTResponseV2 haveError Method

Niclas
Giga Guru

Hi,

The RESTResponseV2 haveError method is returning false if the response has HTTP Status 400 - Bad Request. Is this a bug or intended? When exactly is the haveError Method returning true?

3 REPLIES 3

Aakash Shah4
Tera Guru

Hi,



haveError()

Indicate if there was an error during the REST transaction.



Return:



TypeDescription
booleanReturns true if there was an error, false if there was no error.


Check this link for documentation


https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_RESTResponseV2-haveError


jarodm
Mega Guru

I thought that it would be TRUE for any HTTP 400s or 500s codes. I'll have to double-check in my environment...


I actually now observed that it was returning true. It looked liked it was just an error in my script.