Jump to content

error handling


 Share

Recommended Posts

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!

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
Share on other sites

  • Moderators

Lmao, read my edited post :D

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.

Link to comment
Share on other sites

  • 5 years later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...