Jump to content
Sign in to follow this  
scriptkitty

Error Option for the new COM/OJB

Recommended Posts

Any chance of capturing the error when a COM/OBJ call fails instead of crashing the script?

An AutoIt script will immediately stop execution when it detects a COM error.  This is the default and also the safest setting.  In this case you have to take measures in your script to prevent the error from happening.

Only if there is no way to prevent a COM error, you could install an "Error Handler" in which you take action after the error has happened.

I was just thinking that an option might be a good thing as well.

OBJErrorsFatal Sets if the script should terminate with a fatal error if a Obj/COM function fails due ObjEvent error:

1 = fatal error (default)

0 = silent error (@error set to 1)

Not really needed since you can put in a COM Error Handling function, but was just a thought.

I am really enjoying this new feature.


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Any chance of capturing the error when a COM/OBJ call fails instead of crashing the script?

I was just thinking that an option might be a good thing as well.

Not really needed since you can put in a COM Error Handling function, but was just a thought.

I am really enjoying this new feature.

<{POST_SNAPBACK}>

Hello scriptkitty,

You have answered your own question :-)

The 'COM Error Handler' is indeed required to 'catch' COM/OBJ errors. It works the same way as 'regular' COM Event functions, so that's why I incorporated into ObjEvent and not in a separate 'AutoIt Option'.

Regards,

-Sven

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...