Hi All,
I have run a Python code and its get exception while running a script, and here need to save a exception into a variable and need to get a exception variable using UiPath.
Can any one please help to this
Thanks in Advance…
Hi All,
I have run a Python code and its get exception while running a script, and here need to save a exception into a variable and need to get a exception variable using UiPath.
Can any one please help to this
Thanks in Advance…
Hi @keerthi_arumugam ,
Try following way’s
Use the Try-Catch activity to capture the error message into the catch block and assign the same to variable.
In your Python script use exception handling ( Try and Except method) to catch the exception and save the exception message into the variable in the Python script and use Activities - Invoke Python Method (uipath.com) to get the The result of the invoked method,
Activities - Invoke Python Method (uipath.com)
Hello @keerthi_arumugam
Assign activity:
Invoke Python Method activity:
Assign activity:
Log Message activity:
Thanks & Cheers!!!
i need to get a exception message from the python code
Refer this python code:
PythonCode.txt (1.1 KB)
i.e :exception Variable
My actual scenario is have to break the python script while getting the error in python code.
Thanks in advance
Wrap your Invoke Python activity inside a UiPath’s try-catch. If your script fails, control comes to the catch automatically.
As per you Suggestion i have given a Try catch for the invoke python Activity but I’m
Did the error occur in your Python script?
No in UiPath studio while running a python code with an error.
I meant, did the error occur again in your script?
You can try another way too: use try-catch in your python script and use a boolean flag that determines if the control comes to the catch block in your script.
Tried this way but having previous screenshot and after click close the program will get this pipe broken
Can you got any idea?
If you’re performing any read/write operations, can you check if you’re closing the connection as required?
Didn’t use any read/write operations for my flows so far.
Any luck to solve my issue.
Check this thread:
Invoke Python Method: Pipe is broken - Help / Activities - UiPath Community Forum