Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1367
News FAQ
Search Home


next up previous
Next: Proposal Up: Note 190: Exceptions Changes for AIPS++ Previous: What exception to throw

The what() string

While it is true that debuggers on systems with native exceptions will allow programmers to intercept exceptions, it is also true that programmers will occasionally have to try to recreate a problem only given an error message provided by the what() member function. To make it easy to figure out the originator of the exception, I propose that exceptions that originate from throw() but not Assert* should contain the name of the function to allow the programmer to discover where the error originated.

A format of:

    "Class::member() - error message"
    "Class::member(args) - error message" // if overloading makes it ambiguous
    "::func() - error message"            // global function
    "::func(args) - error message"        // global overloaded function
Should generally be chosen under normal circumstances.

After some reflection, I have decided not to suggest that the function name be embedded in Assert statements -- we want to continue to make it easy for programmers to put in checks for ``impossible'' errors.


next up previous
Next: Proposal Up: Note 190: Exceptions Changes for AIPS++ Previous: What exception to throw
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-03-28