Jump to content
Sign in to follow this  
ParoXsitiC

Restart Script On Error

Recommended Posts

ParoXsitiC

I have a script that uses the IE.au3 include and now and then it will get random errors, rather from internet connection hiccup, an unencountered page I haven't accounted for, random webpage glitches from IE, or random errors from within IE.au3 itself.

How can I make it so that no matter what error occurs, it will close all iexplore.exe processes and start over from Line 1.

Share this post


Link to post
Share on other sites
Achilles

I have a script that uses the IE.au3 include and now and then it will get random errors, rather from internet connection hiccup, an unencountered page I haven't accounted for, random webpage glitches from IE, or random errors from within IE.au3 itself.

How can I make it so that no matter what error occurs, it will close all iexplore.exe processes and start over from Line 1.

I'm not completely sure if this will do what you want, but try this function OnAutoItExit (look for it in the helpfile).

Also: #199608


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites
Jman

Not sure if this will help, but could you place what you want to execuite inside of a loop then @error exitloop. Now I am a complete newb with autoit but I find that trying to help might just help me learn the code better as well.

Func ieactive()

while 1

$iexplorer = ProcessExists("iexplorer.exe")

If $iexplorer = 0 Then
 call(restarter)
Endif

wend

EndFunc

Func restarter()

Runwait("Iexplorer.exe")
sleep(3000)
call(ieactive)
endfunc

Share this post


Link to post
Share on other sites
Juvigy

IE has its own error handler included :

_IEErrorHandlerRegister("MyErrFunc")

Func MyErrFunc()
    $oError =$oIEErrorHandler.description
EndFunc

Then you can check $oError and depending on the description take different actions.

You can ever start the script a second time and exit the current script that is what you mean by "tart over from Line 1"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.