#21 More error handling

open
nobody
None
5
2002-02-04
2002-02-04
Steven Augart
No

Summary:
This patch adds error handling and debugging
routines that are useful
for general robustness.

To unpack:
patch --directory=${althea_source_root} --unified
--forward --strip=1 --backup --ignore-whitespace
more-error-handling.patch

Description:
This patch adds error handling and debugging routines
that are useful
for general robustness.

I have included files ending in .msg, for each changed
source file. These are intended for the CVS log. You
can delete them
afterwards. Thus, you can commit the changed version
of errors.h with:
cvs commit -F errors.h.msg errors.h && rm errors.h.msg

internal_error.cpp: Add routines to handle internal
errors.
The internal_error() functions are for Ťcan't
happenť conditions.

errors.cpp: Adds functions named Success() and Fail(),
for testing
Ťenum errorsť error codes. This abstracts various
ad_hoc tests
such as: (error_code < BEG_FAIL) or (error_code <
END_SUCCESS)
(Both of these forms are currently found in the code!)

errors.h: Added comments.
Added prototypes for new functions, Success(),
Fail(), and the
internal_error() family.

A temporary hack called XXX_CAST_INT_TO_ENUM_ERRORS
is also
here. The hack will go away once we've converted Althea
to handle all error codes as the Ťenum errorsť type
instead
of as the Ťintť type.

Makefile: Added rules for errors.o and
internal_error.o. Also
added a general CXXFLAGS definition, useful for implicit
.cpp ==> .o rules.

Makefile.debugging-warnings:
Added more comments.
Now turns on more warnings specific to the g++ compiler.
Now uses code generation options that may make it easier
to debug inline functions.

Message.cpp:
Began the conversion from integer error return codes to
Ťenum errorsť error return codes.

load_config.cpp:
Added some innocuous debugging code to help track
down a problem
that happens in the get_mail() function call while
load_Server() is running.

support.cpp:
In error(), all error messages now go to standard
error as well
as to a pop-up window. This is the case if
ALTHEA_DUMP_ERRORS_TO_STANDARD_ERR_TOO is defined.
This is part of an
attempt to track down a bug where the error windows
sometimes appear on
my display with no text (althea 0.5.7, gtk 1.2.10,
glibc 2.2.4, and
GNU g++ and libstdc++ version 2.95.3).

Discussion

  • Steven Augart
    Steven Augart
    2002-02-04

    More error handling patches.

     
  • Steven Augart
    Steven Augart
    2002-02-12

    Logged In: YES
    user_id=443064

    This followup patch has the same content. However, it uses
    a new format for the .msg and .msg-* files that I use so
    that
    CVS checkins can be done automatically with the right
    comments
    for each file.

     
  • Steven Augart
    Steven Augart
    2002-02-12

    Supersede previous more-error-handling.patch