This is something I'd like to have everyone's opinion on.
As of late it seems an emphasis on code size has overruled what I would consider proper error handling. What are your thoughts on this?
Handling Fatal Errors vs Code Size
Started by
big_daddy
, Jun 12 2007 05:07 AM
4 replies to this topic
#1
Posted 12 June 2007 - 05:07 AM
BD Scripting - My scripting repository.AutoIt Menu - Firefox extension with several links and tools for the AutoIt Forums!AutoIt Snippets Database - Store and share all your favorite snippets here! Welcome to AutoIt 1-2-3 - Great starting place for newcomers.Learning to Script with AutoIt - Another good starting place for newcomers.SciTE - The best AutoIt Script Editor.
#2
Posted 12 June 2007 - 05:53 AM
for 50k I prefer handle fatal error.
in fact the pb is not a autoit fatal error but a crash of autoIt
in fact the pb is not a autoit fatal error but a crash of autoIt
#3
Posted 12 June 2007 - 09:55 AM
Very interesting big_daddy.
I'm a fan of leaving the fatal error handling up to the programmer. Let the programmer decide where to look out for errors and capture them.
I'm a fan of leaving the fatal error handling up to the programmer. Let the programmer decide where to look out for errors and capture them.
#4
Posted 12 June 2007 - 10:37 AM
I have to been thinking a little about error handling in AutoIt lately. I have not thought it trough yet but I think I would like an option to register an error handler along the same lines you do for com objects would be an achievable solution. Maybe add a @functionid macro to identify the failing function. The custom error handler provided by the coder could look like this;
If ErrHandler is called with an empty string it is disabled.
You should still be able to use the @error and @extended macros as we do today.
Well that was my $0.02 on the topic. I'm sure the devs can find lots of cases where this approach will be impractical.
EDIT: Language typo
Func ErrHandler($err, $ext, $funcid, $line) MsgBox(48, "ERROR", "Error occured at line: " & $line" & @CRLF & "NOTE: I will terminate now..:(") ;Note : If the programmer odn terminate the application at this point it will continue as usual. EndFunc oÝ÷ Ø Ýr¥u·®±çeG+ºÚ"µÍÌÍÛÛ[HÜ[YÚÝ ][ÝÑ[][ÝÊBÈÈ^HÝYÜ[YÚÝ ÌÍÛÛ[B
If ErrHandler is called with an empty string it is disabled.
You should still be able to use the @error and @extended macros as we do today.
Well that was my $0.02 on the topic. I'm sure the devs can find lots of cases where this approach will be impractical.
EDIT: Language typo
Edited by Uten, 12 June 2007 - 10:38 AM.
Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions
Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
#5
Posted 05 October 2007 - 06:18 PM
Even with larger code requirements, I believe in error handling on the part of the software's programmer. Case in point, my most recent monster has frankensteined to over 2100 lines, but it's not a complaint. A good 1/3 of the code is error checks. For this particular program, the error checks are necessary. If this was just for personal use, I'd not have near the If @error Then xyz EndIf statements.
Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





