Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 49146

Re: Error handling for external REST API call

$
0
0

Hi,

 

The response object contains also the status code as a number. In your sample, you should be able to retrieve it with something like (after line 12):

 

var status = response.statusCode;
if (status >= 400) {    System.log("Got an error status code");
} else {    // ...
}

Viewing all articles
Browse latest Browse all 49146

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>