cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rchilakalapu
Frequent Visitor

Capture Runtime error into variable - Power automate desktop

Hi,

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.

 

Thanks,

Raghavendra CH

4 REPLIES 4
Rkv_
Resolver II
Resolver II

@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. 

 

Rkv__0-1644384773857.png

I have configured to go to end of the block in on block error, also I have enabled capture unexpected logic errors.

 

Rkv__1-1644384850187.png

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.

rchilakalapu
Frequent Visitor

Thanks for the reply.

I have tried option but not successful.

 

rchilakalapu_0-1644420192713.png

 

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:

rchilakalapu_1-1644420348550.png

but not successful.

 

Could you @Rkv_  please provide more inputs.

 

Thanks,

Raghavendra CH

1 )if you have set timeout, increase the time from the default value

sri24_0-1665465926895.png

 

2) use "wait for web page content " action

sri24_1-1665465985289.png

 

 

Jamar_Forsythe
Microsoft
Microsoft

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:

Jamar_Forsythe_4-1665944548311.png

Exception handling mode "Go to end of block" will exit the block as soon as an error occurs.

Jamar_Forsythe_3-1665944162261.png

My Error was captured in the %LastError% Flow variable.

Jamar_Forsythe_2-1665944095726.png

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,428)