* Melchior FRANZ -- Monday 02 July 2007:
> I would definitely not ignore a message from the traffic manager:
> 
>  Traffic Manager problem in src/Traffic/TrafficMgr.cxx, line 341:
>  routing problem in EHAM data -- no endpoint found

OK, here's the first addition: I've just added a macro SG_ORIGIN
that expands to a string <filename>:<line>. Yes, it's very trivial,
but has the advantage over an explicit __FILE__":"__LINE__ that
it actually works.  ;-)   (__LINE__ is a number, so a simple
concatenation doesn't work)

This file information isn't useful for the user, so it shouldn't
appear in user messages ("airport KFOO doesn't exist"), but
for messages explicitly directed at the developer.



> or something. We could also pause fgfs and show that in a dialog. Hey,
> we even have such error dialogs, but they are so badly rendered that
> nobody uses them. On my TODO list since a long time ...  :-)

That's now fixed, too. Better layout, correct treatment of \n.
So, if the user should really be noticed *immediately*, just
output a message. Pause the sim if necessary.

  #include <GUI/gui.h>
  guiErrorMessage("OMG!\nRouting problem!\nHelp! Help!");

And still there's no excuse for an exit() in the code. Bark
and continue. Don't stop unless unavoidable.

I'll start to weed out all exit()s, so if anyone insists on his,
he should better add a comment where he explains why it needs to
be there. We might also think about adding another macro:

  #define I_CAN_T_BE_BOTHERED_TO_WRITE_CLEAN_CODE  exit(1)

m.   :-}

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to