Alan W. Irwin writes: > Maurice and Geoffrey, please correct this if I have it wrong, but I believe > plwarn should be reserved for a warning where there is a reasonable fixup > available (e.g., "Driver does not support hardware solid fills, switching to > software fill.\n"), plabort should be reserved for the case where no > reasonable fixup is possible so the particular operation has to be aborted > (e.g., "plscmap1l: Must specify at least two control points"), and plsexit > reserved for the case where immediate termination is necessary (e.g., > "Unable to load driver"). I emphasize this is an ideal interpretation, and > even casual grepping through the code shows lots of places where e.g., both > plabort and plexit are used for insufficient memory conditions so obviously > there would be a lot of work to attempt to bring plplot into compliance with > this ideal interpretation. > > Assuming everyone agrees with my ideal interpretation of the three different > calls, then that interpretation means plabort is actually an error where we > need to set a status code that is eventually delivered when the library is > closed. I was thinking along the lines of setting up plsc->errcode from > plwarn (similarly to the way that plsError does it, or perhaps with a call > to plsError), then call exit(*(plsc->errcode)) from plend if plsc->errcode > is not NULL.
While a call to plabort() may represent an internal plplot error, the fact that it is not fatal nor necessarily interfering with future plot calls makes it difficult to justify any error code set upon exit. It just means that the particular operation attempted by the user was a miserable failure. :) Future operations could be fine. And people do have the option of overriding the abort handler, which I highly recommend. One thing I've wanted for a while now is an additional plswarn() call where the user can insert their own warning handler. That way, the output can appear exactly how the user desires. plwarn() would call it and do nothing else, if the warn handler was specified. > Finally, there is the messages associated with plabort and plexit. If they > are both errors, then perhaps the messages should read something like > > *** PLPLOT ERROR, ABORTING OPERATION *** > > and > > *** PLPLOT ERROR, IMMEDIATE EXIT *** > > for the two cases? Looks ok to me. -- Maurice LeBrun ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel