Jump to content



Photo

Handling Fatal Errors vs Code Size


  • Please log in to reply
4 replies to this topic

Poll: Handling Fatal Errors vs Code Size (22 member(s) have cast votes)

Which do you feel is more important?

  1. Handle Fatal Errors, But Larger Code Requirements (18 votes [81.82%])

    Percentage of vote: 81.82%

  2. Allow Fatal Errors, But Smaller Code Requirements (4 votes [18.18%])

    Percentage of vote: 18.18%

Vote Guests cannot vote

#1 big_daddy

big_daddy

  • Moderators
  • 2,499 posts

Posted 12 June 2007 - 05:07 AM

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?
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. Posted Image





#2 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 8,925 posts

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

#3 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

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.

#4 Uten

Uten

    stupid is as stupid does..

  • Active Members
  • PipPipPipPipPipPip
  • 1,987 posts

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;
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·®±çeŠG­†+ºÚ"µÍ‰ˆÌ ͎ÛÛœ’[™ˆ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.


#5 Blue_Drache

Blue_Drache

    Revolutionary Flavour

  • Active Members
  • PipPipPipPipPipPip
  • 3,169 posts

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 DrachePosted ImagePosted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users