Jump to content

My Sloppy but working Basic Error Handler


GoogleDude
 Share

Recommended Posts

Hello,

I have made a very sloppy but working (at least for me) Error Handler for Compiled or UnCompiled AU3 scripts. Since I lack good clean AU3 scripting skills like most other on this board I will admit it is very sloppy and most of the real work came from jennico and MrCreatoR. Since I was having trouble getting theres to work with the latest version of autoit I tweak the holy hell out of it until it worked in a very very basic manner.

I know a lot can be cleaned up and improved but I will leave that to whom ever cares to play with it.

Again this is very basic but it was a big learning process for me. :graduated:

Things to note :

AutoIt Script v3.3.6.1 was used at the time I did this.

Works with Compiled and UnCompiled Scripts

It does not have a fancy GUI with pretty buttons - very basic. 2 buttons (Send Bug Report & Close Program)

All it does it catch a script error and show a basic description of the error to the user and allow him/her to send a bug report to the developer.

It can collect an email address from user at the time the bug report is sent to the developer so the user can be notified of new versions of the script that fix said error.

To keep down on size the binary used to send the email (sendemail.exe) which is 1.6MB in size is downloaded from the internet at time of bug report being sent.

For info on SendEmail.exe

Since I myself dont care to get emails of uncompiled scripts it only tells the user the script error description such as "Error parsing function call" for example.

I am not sure how to get the full au3 script error along with line number ect.. from a compiled script. When I was testing it with compiled scripts it was giving me the line number in the EXE itself which was like line number 756 for example. If someone can fix that it would be great. I would like to be able to hide completely the autoit error that pops up really fast before my GUI catches it. Anyone know how to do that?

It took 30mins to type this all up it only takes 3 seconds for someone to say "What the hell is he thinking" lol.

I am ready for a lot of criticism! :(

Posted Image

Posted Image

This is where sendemail.exe is downloaded from the internet

Posted Image

Posted Image

_MyErrorHandler.au3

test.au3

Edited by GoogleDude
Link to comment
Share on other sites

Hi ive tried and it works fine. i get an email and im v happy thanks. I was wondering what this line is used for?

RunWait(@TempDir & '\sendemail.exe -f thelistedemailaddress@gmail.com -xu thelistedemailaddress@gmail.com -xp thepassword -s smtp.gmail.com:587 -m '&StringFormat($sErrorMsgFormat, $sScriptPath, $sErrDesc)&' -u Error with AutoIt Script '&@ScriptName&' -t thelistedemailaddress@gmail.com',"",@SW_HIDE)

i only ask as i declare my email above so if i didnt look through code i would have seen it. Your email details are here. you might want to remove them from your script. But what is it for if the email is sent prior to this?

thanks

(edited)

by request of topic owner to remove personal email address

Edited by engjcowi

Drunken Frat-Boy Monkey Garbage

Link to comment
Share on other sites

Instead of loading a 1.6m exe from the internet to send an email couldn't you do it with pure AutoIT? You could use this

Or use something small like blat (155kb)?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

Instead of loading a 1.6m exe from the internet to send an email couldn't you do it with pure AutoIT? You could use this

Or use something small like blat (155kb)?

The reason I used sendemail.exe is because it allowed me to use a TXT file as the message body of the email being sent. I thought it could be usefull when collecting system info.

Thanks for the info on blat. I will check it out.

~GD

Edited by GoogleDude
Link to comment
Share on other sites

Hi GoogleDude,

Looks pretty useful! I'll be using this in the next release of my application; iTunesTweet :graduated:

James

Edit: Taking a closer look at the code it seems to call another EXE hosted on DropBox. No thanks.

Yes I agree. I didnt think about how some people might look at that. You can simply replace that URL with the URL that is hosting sendemail.exe as long as it is a direrct download link. I was trying to keep the initial size of the compiled script down.

~GD

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

  • Recently Browsing   0 members

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