Leo1906

Get rid of Autoit Error Messages when exe fails

14 posts in this topic

#1 ·  Posted (edited)

Hey there,

I didn't really know how to name the titel .. so let me explain it a bit further.
You all might know that a compiled Autoit-Exe gives an error message containing the Error and the line when it crashes. Often those messages aren't usefull because it states the line in the compiled script is not the line in your script if you have used includes. Decompiling the exe often doesn't help either. Well .. I don't want to start a discussion about the benefits of those messages.
I just want to disable them. I want my exe to just fail an crash and that's it. Nothing more. When there's an error there's an error. Autoit is the only language I have ever noticed those message boxes.

I think now you can understand me .. :D

Do you know any way to do this?
Some compiler options or so? Or is it that deep implemented in Autoit that it can't be removed?

Thanks for your help!
Leo1906

Edited by Leo1906

Share this post


Link to post
Share on other sites



Leo1906,

Quote

Decompiling the exe

You appear not to have read the Forum rules since your arrival. Please do read them - particularly the bit about not discussing decompilation (and even mentioning it is not a good idea) - before you post again.

Quote

 the line in the compiled script is not the line in your script if you have used includes

It can be if you use Au3Stripper with the /MergeOnly option before compiling.

M23

 


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
1 minute ago, Melba23 said:

Leo1906,

You appear not to have read the Forum rules since your arrival. Please do read them - particularly the bit about not discussing decompilation (and even mentioning it is not a good idea) - before you post again.

It can be if you use Au3Stripper with the /MergeOnly option before compiling.

M23

 

Ok you're right. So let's not talk about decompiling aggain.
And thanks for the info on the /MergeOnly :)

.. but this doesn't answer the question. It's not about how usefull it might be. In my opinion those messages are just ugly and I don't want them to appear.

An example I noticed today:
I was trying to read a really huge csv to an array and the program failed, saying that it was to much data for an array.
Nice to know (for me the developer) but completly useless for somebody who doesn't know about those things. It could even be frightening.

Share this post


Link to post
Share on other sites

It's the responsibility of the developer to check, for example, if too much data is being read into an array and take the appropriate action to prevent an error occurring in the first place. A well written application will not produce the error messages you want to get rid of.


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites
Just now, Bowmore said:

It's the responsibility of the developer to check, for example, if too much data is being read into an array and take the appropriate action to prevent an error occurring in the first place. A well written application will not produce the error messages you want to get rid of.

Why does everybody seems to only glance on the Offtopic parts of this thread?

I think there can always be unexpected errors. In my example the maximum length of an array was exceeded. Didn't thought this would happen. (it would have been an array with over 1.000.000 entries,

Despite that I don't think that there are many programs out there wich would definitly never crash, because the developer/s checked every detail meticulously.

 

Please focus on the question and if you have nothing to contribute to the topic than just let it be ..
Thanks :)

Share this post


Link to post
Share on other sites
29 minutes ago, Leo1906 said:

Please focus on the question and if you have nothing to contribute to the topic than just let it be ..
Thanks :)

Ahem, this is a public forum.  Members are responding as they see fit.  I'm sorry you don't like it, but that's not their problem.

Sure, there can always be unexpected errors, but a robust program is as efficient and error free as possible.  There is no reason why a script can't be designed to address known conditions/limits that could cause the script to fail.  


Search the forum for Error Handling to get some ideas.

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

1 hour ago, Leo1906 said:

Ok you're right. So let's not talk about decompiling aggain.

In this forum you mustn't talk about decompiling. Read about Software License in helpfile specialy:

Quote

Reverse engineering. You may not reverse engineer or disassemble the SOFTWARE PRODUCT.

I think @Jos isn't amused about your intend

Edited by AutoBert

Share this post


Link to post
Share on other sites
4 minutes ago, AutoBert said:

In this forum you mustn't talk about decompiling. Read about Software License in helpfile specialy:

 

Haha ok I can do this too ..

The License says:

Quote

The definition of SOFTWARE PRODUCT does not includes any files generated by the SOFTWARE PRODUCT, such as compiled script files in the form of standalone executables.

Quote

Reverse engineering. You may not reverse engineer or disassemble the SOFTWARE PRODUCT.

You see: I am totally allowed to decompile my OWN scripts. I am just not allowed to decompile Autoit and the parts of it like the compiler or so!

 

And now let's talk about the forum:

Quote

 Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects:

[...]

  • Decompilation of AutoIt scripts or details of decompiler software.

My intention was not to start a topic about decompilation. That was all you guys could focus on ..
I also didn't post a link or asked for help with decompilation!

It was just a side note. I didn't expect you guys to take it so seriously ..?!

 

 

And now what? Am I the only one that thinks that this thread is now completly Offtopic? In other forums I am used to the method of "Offtopic is forbidden" ...

I was just asking if there's a way to disable the error functions. I now see that it is either not possible (a simple no would have been enough) or that yu guys just don't know about it ..

Share this post


Link to post
Share on other sites

@AutoBert asked and answered by a Mod - there is no reason for you to do nothing more than parrot what has already been said.

@Leo1906 I would highly suggest you check your attitude toward forum members who are trying to assist. I agree with others, who can't seem to wrap their minds around why you want to take the lazy route and "hide" error messages rather than coding correctly. It seems you are looking to this community to tell you it is okay to adopt bad coding processes, and I don't see that as something you're going to hear (and shame on the person who does tell you that).

It boils down to this:

  • Can you handle error and do proper error checking? Yep, spudw2k has already given you suggestions
  • Is anyone going to waste their time and effort helping you completely hide all errors, effectively making anything you code Crapware? Don't hold your breath :)

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
1 minute ago, JLogan3o13 said:

 

@Leo1906 I would highly suggest you check your attitude toward forum members who are trying to assist. I agree with others, who can't seem to wrap their minds around why you want to take the lazy route and "hide" error messages rather than coding correctly. It seems you are looking to this community to tell you it is okay to adopt bad coding processes, and I don't see that as something you're going to hear (and shame on the person who does tell you that).

I'm sorry. I didn't want to get rude to anybody. I wasn't expecting this when I started the thread ..
And as I stated 

Quote

Well .. I don't want to start a discussion about the benefits of those messages.

And I don't get it when people do exactly what I was NOT trying to achieve.

I like to apologize to the people I offended and thank those who actually wanted to help me :)

Share this post


Link to post
Share on other sites

Some ideas why I would NOT suppress run-time error messages:

When a script crashes when used in prodcution those run time error messages are helpful.
Imagine you suppress all error messages debugging gets much more complex. Recreating the error means to know exactly what the user did (buttons pressed, data entered etc.).
Most of the time the answer you get is: "I did nothing wrong. Suddently the program crashed."

So error messages at least provide a starting point for debugging.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
3 hours ago, JohnOne said:

 

Thats perfect and exactly what I was looking for :)
Thanks for that! Now I have the option for disabling the messages completly or even show nicer error messages :)

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

  • Similar Content

    • leke
      By leke
      Hi, My .ts ripping app works the first time it's executed, but then fails for some reason with an error. I can't figure out why I'm getting this message though. The variables used on line 55 should be declared. $TsPath is declared as a Global before the error is called. 
      This is line 55...
       The error and source code (also attached)...
      ; ffmpeg info: ; also: http://forum.videohelp.com/threads/289790-mencoder-ts-to-avi-%28x264%29-with-multiple-audio-stream ; http://linuxers.org/tutorial/ffmpeg-basics-beginners ; ffmpeg -i test.ts -t 10 -b 1000k -vcodec libx264 output.mp4 ; MsgBox(0, "Debug", @ScriptDir) $ini_ffmpeg_location = IniRead("ts-ripper-config.ini", "Settings", "ffmpeg location", "NotFound") ; Get path of ffmpeg.exe from config file $ini_default_path = IniRead("ts-ripper-config.ini", "Settings", "Default location", @ScriptDir) ; Read last user defined location from the db. If FileExists($ini_ffmpeg_location & "\ffmpeg.exe") Then Call("PrepareRip") Else Call("LocateFfmpeg") EndIf Func LocateFfmpeg() ; locates the ffmpeg.exe if not found. Local $LocateFfmpegQuestion = MsgBox(1, "Whoops!", "ffmpeg.exe was not found." & @CRLF & @CRLF & "Click Ok to search for ffmpeg.exe") Switch $LocateFfmpegQuestion Case 1; Ok Global $WhereIsFfmpeg = FileOpenDialog("Locate your ffmpeg.exe", @ScriptDir & "\", "Exe (*.exe)", 1 + 4) If @error Then MsgBox(0, "!", "No File chosen - I quit!") Exit ElseIf $WhereIsFfmpeg == 2 Then ; Cancelled MsgBox(0, "!", "No File chosen - I quit!") Exit Else $FfmpegFolder = StringLeft($WhereIsFfmpeg, StringInStr($WhereIsFfmpeg, '\', 0, -1) - 1) ; copy the folder only from $TsPath IniWrite(@ScriptDir & "\ts-ripper-config.ini", "Settings", "ffmpeg location", $FfmpegFolder) ; Write last user defined folder location of ffmpeg.exe the db. If FileExists($FfmpegFolder & "\ffmpeg.exe") Then Call("PrepareRip") Else Call("LocateFfmpeg") EndIf EndIf Case 2; Cancel -> Exit program MsgBox(0, "!", "No File chosen - I quit!") Exit EndSwitch EndFunc Func PrepareRip() ; locate the file to rip. Local $PrepareRipQuestion = MsgBox(1, "Step 1:", "Select your .ts video file") Switch $PrepareRipQuestion Case 1; Ok Global $TsPath = FileOpenDialog("Locate your .ts file", $ini_default_path & "\", "Video (*.ts)", 1 + 4) If @error Then MsgBox(0, "!", "No File chosen - I quit!") Exit ElseIf $TsPath == 2 Then ; Cancelled MsgBox(0, "!", "No File chosen - I quit!") Exit Else $TsFolder = StringLeft($TsPath, StringInStr($TsPath, '\', 0, -1) - 1) ; copy the folder only from $TsPath IniWrite(@ScriptDir & "\ts-ripper-config.ini", "Settings", "Default location", $TsFolder) ; Write last user defined location from the db. Call("RipIt") EndIf Case 2; Cancel -> Exit program MsgBox(0, "!", "No File(s) chosen - I quit!") Exit EndSwitch EndFunc Func RipIt() ; Creates rip in same folder as original. $ffmpeg_command = $WhereIsFfmpeg & " -i " & $TsPath & " -b:v 1200k -vcodec libx264 " & $TsPath & ".mp4" ; The ffmpeg rip settings. Run($ffmpeg_command, "", @SW_MAXIMIZE) ; the ffmpeg command. EndFunc  Does anyone know how to fix this? 
      Thanks
      Source code.au3
    • Skysnake
      By Skysnake
      Howdy, 
      In a bizarre twist of events a client installed McAfee Antivirus Plus (the paid version).  I have scripts running there, the simplest is a little HTTP downloader, which opens HTML pages and downloads some files.  These scripts have been running for years.  The new AV kills the process.  The process just "disappears" with no warning.
      I can not find an "exception" setting.  IT on site had to kill it in the Task Manager and restart the PC.  All other AV products (even the free ones) have an easily accessible Exception setting.
      Note that the standard McAfee that typically comes with Acrobat does not do this, yet.
      Any advice on this please? Other than "get a new AV"? This has been suggested and as they just dished out the cash, not a current option.