Can I capture a HTTP Connection Error

Is there a way I can do a try except, but only for a connection error when I conduct a web service call

Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: HTTP Error: 503 - Service Unavailable (at https://RDG12006.QPLAS.COM:30518/m3api-rest/execute/PMS230MI/Select;maxrecs=0;excludempty=false;metadata=false;returncols=MFN1,WOS1,SCH1,SCH2,WOS2?CONO=001&FACI=100&PLGR=2004)

In the designer on the configuration screen for that web service consumer you can unselect “Enable error reporting for failure HTTP response codes.” If you do that you will get back the http response instead of an exception and then you can take appropriate action from there in your script depending on the response code.

1 Like