I have a python geoprocessing toolbox that was published from Pro 2.9.5 to a 10.9.1 Enterprise server. I would like to display the error messages from the tool to a web UI, but I cannot find a way to only return the string in the raise error. For example, with the message level set to 'error', the tool always returns 5 messages
This is the code creating the error:
How uncaught exceptions are handled is at the discretion of whatever's running Python, which in this case is the Web Tool infrastructure, so you're limited in how you can format your errors. A long shot might be the sys.tracebacklimit global, this SO post implies it might be able to cut down on what ArcGIS can report on.