JSON web get timeout makes variable null, how to not


#1

Hey guys,

I have a JSON web query thats been working fine for months.
Problem is the supplier has an outage right now and I’m getting the error

║Error executing external web request: java.net.SocketTimeoutException: Read timed out

And due to this its setting my global variable to null and breaking all sorts of things.
How can I hard set a value if this web JSON fails, see my example test attached, i have tried the text null too.


#2

Why not try:

IF $response.price is between 2000 and 4000
Then
Set variable @spot_price = $response.price
Else
Set variable @spot_price = 2000

(Adjust the numbers in the line 1 to fit your needs)

An alternative is to leave the Else section blank. This means the old number will linger in your globals until a new number comes in


#3

Try

if $httpStatusCode is not 200