Capture Python API Errors in Jupyter Notebook Cell Output

161
1
03-15-2024 07:15 AM
AndrewKesterton
New Contributor III

Hi Geonet community, 

I am trying to use the Python API in Jupyter Notebook to test the availabilit of ArcGIS Server feature services. When a service is inaccessible an error message in pink is output from the notebook cell, but no exception is raised.

inlineerror.png

I would like to capture these issues to use elsewhere, is there a way to capture either the error outputs from the cell, or have the API raise an exception? 

Thanks

Andrew

 

0 Kudos
1 Reply
jcarlson
MVP Esteemed Contributor

I don't know about a way to do it within the API, but you could just use requests to ping the service endpoints and parse the response.

- Josh Carlson
Kendall County GIS
0 Kudos