Jump to content

Get rid of Autoit Error Messages when exe fails


Recommended Posts

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

  • Moderators

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

 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

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

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

Link to comment
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 :)

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Moderators

@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 :)

"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

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 :)

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

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

×
×
  • Create New...