Sign in to follow this  
Followers 0
jjj

error handling

8 posts in this topic

I am trying to catch all autoit errors and write them to a log file instead of popping up a message box. Also, i want the script to exit quietly if it encounters a fatal error.

Is this possible? I havent been able to find anything directly relating to this on the forums, or the help file.

Thanks in advance!

Share this post


Link to post
Share on other sites



I am trying to catch all autoit errors and write them to a log file instead of popping up a message box. Also, i want the script to exit quietly if it encounters a fatal error.

Is this possible? I havent been able to find anything directly relating to this on the forums, or the help file.

Thanks in advance!

There is no ON ERROR like VB, only for COM objects.

Its just a matter of proper error checking and you shouldn't get any errors... :D


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Do you think that this ON ERROR function would be included at some point? I was actually looking for something similar. My situation isn't really a programming error issue. The user would have to input the path to a particular application to use a menu item, now if they don't remember to input that path, when they try to use that menu button they get the dreaded autoit error pop up. What I wanted to do was some type of error handling where a pop up would actually say "you did not input the path" instead of a bunch of gobbly gupe....I used variables so it looks like a bunch of gobbly gupe.

I tried

If @error Then MsgBox(16, "Failure", "blah.")

on the line after the Run command but it didn't work

Is there a way to do this, or am I stuck with the autoit error pop up if the path isn't inputted? Also I don't see a definitive way of using error handling in the help file, can I get some directions on where to get clear info on it?

Thanks.

Edited by Champak

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Do you think that this ON ERROR function would be included at some point? I was actually looking for something similar. My situation isn't really a programming error issue. The user would have to input the path to a particular application to use a menu item, now if they don't remember to input that path, when they try to use that menu button they get the dreaded autoit error pop up. What I wanted to do was some type of error handling where a pop up would actually say "you did not input the path" instead of a bunch of gobbly gupe....I used variables so it looks like a bunch of gobbly gupe.

I tried

If @error Then MsgBox(16, "Failure", "blah.")
oÝ÷ ÚíébæµêíänÊ&©ÝnëbµØmÂä"Ëaz·Á¬­¡Ú-+(­©²Û­Ø^jëh׫®é¢©ûaz­+'ßÛb­µç@Êv÷öÛy§^~)â¶+ÞÁ¬¨~ë"«®ájwex"Ø^éi~)^q©Èël¢g·¶*'²ðêÞ¶µÉ^j¸§~'Ôájy,þ«¨µå¨ºWgßÛm«ljeÉ·yú+{*.®»§jëh×6
If $Var_That_Holds_My_Path_Value = '' Then MsgBox(16, "Failure", "blah.")
oÝ÷ ØGb´êѺq+®ájwex%G­+ºÚ"µÍÜ
    ÌÎNÔ[ÜÑ][  ÌÎNË
B[  ÌÎNÕÚ]]^IÌÎNÊBYÜ[ÙÐÞ
M   ÌÎNÕØ[ÉÌÎNË ÌÎNÕ[ÜXÚYXÙYØØ][ÛÜ[IÌÎNÊ
Don't change the "Whatever.exe" and run it, you should get the msgbox.
Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

You have such timing. I was just returning to say I solved it, but I used:

Opt("RunErrorsFatal", 0)

and

If @error = 1 Then MsgBox(0, 'blah', 'error')

Thanks anyway.

But I might be back in a little bit, I'm trying to go over a few other error things that need input from the user that aren't using the Run command.

Share this post


Link to post
Share on other sites

Lmao, read my edited post :D


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Call us Quick Draw. :D

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I would it to work for the run command but it does not?

Edited by Scriptmaster

shutdown(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  
Followers 0