How to catch MapdlExitedError #3728
-
My code sometimes throws Exceptions of type MapdlExitedError. The structure is like this:
In my last run the error occurred inside loop 1, the programme continued to run until the end of the loop, throwing MapdlExitedError at each iteration, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
from ansys.mapdl.core.errors import MapdlExitedError
|
Beta Was this translation helpful? Give feedback.
-
@imhsaq Which version of PyMAPDL are you using?? |
Beta Was this translation helpful? Give feedback.
from ansys.mapdl.core.errors import MapdlExitedError
Then catch the MapdlExitedError. What I would suggest is to put all your mapdl commands within a function and iterate the execution of function in your for loop. It's important to restart your mapdl instance after it has been exited by the error.
Example: