I have some preconditions to run my python script tool, for example that you have to create a local copy for editing first when using a hosted feature service layer. I can use exit() with an if statement (I also tried exit(0) and exit(1)) and it stops my script but it "pretends" to have ran succesfully which it did not (because I stopped it before proceeding). I would like to show the user a last message so he knows what he has to do before running the script again. Like the system error messages you find in that geoprocessing window but more helpful 😉
Solved! Go to Solution.
Luke already gave me the correct answer but to answer your question (and maybe to give a hint to other people reading this): I am running the script from a Script tool (from the toolbox) within ArcMap 10.6.
Thanks Luke! Why I didn't find that option?! That does exactly what I was looking for.
I have script validation in my script but there are a couple of still valid steps that would throw an error at a later stage whith an error message that my client would not understand 😉