Need to capture runtime error into a variable.
Wanted write that variable into log file. Tried Get last error option, but no use.
Could anybody provide solution.
@rchilakalapu You can use onblock error new feature Capture Unexpected logic errors to capture Run time errors along with Get Last error action to capture run time errors.
In the below example i am trying to close browser which is not initialized.
I have configured to go to end of the block in on block error, also I have enabled capture unexpected logic errors.
So the flow control will go to end of the block whenever if fails with runtime error.
we will use the Get last error action to retrieve the run time error.
I hope the above helps you.
Thanks for the reply.
I have tried option but not successful.
Here is the snippet of my flow.
Flow is to open edge browser, wait for some text for specified time(20sec).
Run time error is thrown 'Timeout error".
Trying to capture following timeout error:
but not successful.
Could you @Rkv_ please provide more inputs.
When you say the "Get Last Error" option didn't work, could you explain how you have the "On Block Error" configured and the "Get Last Error"?
In order for this to work, you should use the "On Block Error" action and set "Continue flow run" instead of "Throw Error", This setting will allow the Flow to continue and still record the error. Depending on the type of error, you may want to enable "Capture unexpected logic errors" too. After this "On Block Error" has run, use the "Get Last Error" action. See my example:
Exception handling mode "Go to end of block" will exit the block as soon as an error occurs.
My Error was captured in the %LastError% Flow variable.
Keep up to date with current events and community announcements in the Power Automate community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!