web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Capture Runtime error ...
Power Automate
Unanswered

Capture Runtime error into variable - Power automate desktop

(0) ShareShare
ReportReport
Posted on by 7

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

  • Rkv_ Profile Picture
    166 on at

    @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 Profile Picture
    7 on at

    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

  • sri24 Profile Picture
    31 on at

    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 Profile Picture
    Microsoft Employee on at

    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

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 335 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard