vincentlimwy
(Lim Boon Yang Vincent)
March 25, 2025, 2:45am
1
Hi, I tried to convert String to Double within a Try Catch loop. If conversion is unsuccessful, it will throw an exception and set the Double variable as 0. It was working fine in the past. I’m not sure why it is not working now.
The input variables are:
The UiPath Studio flow are:
The error thrown below.
Yoichi
(Yoichi)
March 25, 2025, 2:53am
2
Hi,
It seems GlobalExceptionHandler works. For now, can you try to remove Handler as the following image?
Regards
2 Likes
Hi @vincentlimwy
Use TryParse instead of relying on exception handling:
Double.TryParse(stringVariable, doubleVariable)
This prevents the need for a Try-Catch and ensures doubleVariable = 0 if conversion fails.
If you still suspect a Global Handler issue, check if the handler is interfering by temporarily disabling it and running the workflow.
If you found helpful mark as a solution.
Happy Automation
1 Like
@vincentlimwy
If Global exception handler is not enabled - Could you please add one more catch exception for
System.InvalidOperationException and set the value as 0 there as well
1 Like
vincentlimwy
(Lim Boon Yang Vincent)
March 25, 2025, 7:09am
5
Thank you Yoichi for your help. I followed this method and it works!
2 Likes
vincentlimwy
(Lim Boon Yang Vincent)
March 25, 2025, 8:52am
6
Thank you Prashant for your reply. I used the Global Handler method mentioned above and it works. Thank you for the quick help!!
1 Like
vincentlimwy
(Lim Boon Yang Vincent)
March 25, 2025, 8:53am
7
Thank you Sharazkm for your reply. I used the Global Handler method mentioned above and it works. Thank you for the quick help!!
1 Like
system
(system)
Closed
March 28, 2025, 8:54am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.