Burgaud Posted June 16, 2020 Share Posted June 16, 2020 (edited) ie, everytime my script encounters an error, instead of popping an error message then croaking, it instead either writes the error into a text file (line # or whatever), or execute an external app. PS.. I am not referring to handling "@error" codes. Is it possible? thanks! Dan Edited June 16, 2020 by Burgaud Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 16, 2020 Moderators Share Posted June 16, 2020 You say "not handling @error codes", but you need to handle the errors (whether that is a pop up or writing to a log file or the event viewer) in order to do something with them; it isn't an automatic thing. How about an example of an error you're meaning to catch, so we can offer suggestions? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Burgaud Posted June 16, 2020 Author Share Posted June 16, 2020 (edited) i dont need/want to handle the errors. I want autoit instead of croaking and popping the error window, it would print it to file so I can review it. By "it" I am not referring to my script, but the autoit engine itself. Example of error? If I know where the error I wont be asking... whenever the error occurs, the users would click click and no more evidence of error... Edited June 16, 2020 by Burgaud Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 16, 2020 Moderators Share Posted June 16, 2020 If autoit.exe "croaks and pops an error window" it is because of something in your code, so yes you as the one writing the code have to handle it. What other language do you know that automatically handles every possible error? AutoIt doesn't just randomly crash; if you cannot come up with an example in which this "croaking" occurs, how can you expect anyone to assist? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
water Posted June 16, 2020 Share Posted June 16, 2020 You mean something like this? If yes, then there is a way to write this to a file for debugging. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 16, 2020 Moderators Share Posted June 16, 2020 @water you are correct, but I would not call that "the AutoIt Engine croaking" personally; it would still be something that should be accounted for in the code. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
water Posted June 16, 2020 Share Posted June 16, 2020 Correct I once had the need to write such messages to a file because my script (which was far from being perfect) was run on a server. When the message popped up the script simply hung and I had no idea what caused the problem. So writing the error message to a file greatly helped to pin down the cause. I then changed the code to handle the problem for the future. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Burgaud Posted June 17, 2020 Author Share Posted June 17, 2020 @water, Script is in au3, not compiled. And yes, I need autoit to print to file the error messages that killed the script. Dan Link to comment Share on other sites More sharing options...
water Posted June 17, 2020 Share Posted June 17, 2020 trancexx helped me to solve this problem: My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Burgaud Posted June 23, 2020 Author Share Posted June 23, 2020 THIS solution is out-of-the-box! Link to comment Share on other sites More sharing options...
argumentum Posted June 23, 2020 Share Posted June 23, 2020 On 6/17/2020 at 10:15 AM, water said: trancexx helped me to solve this problem: ..and I made a UDFish out of it Burgaud 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Earthshine Posted June 23, 2020 Share Posted June 23, 2020 I use log4a au3 for all my error logging My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now