#include <error.h>
Collaboration diagram for ErrorReporterTree:

Usage will be
bool has_error = 0; error_reporter_tree_start(); do_subordinate_tasks(); if(error_reporter_tree_has_error()){ has_error = 1; }else{ has_error = 0 } error_reporter_tree_end(); if(has_error){ ERROR_REPORTER_NOLINE(ASC_USER_ERROR,"failed"); }else{ ERROR_REPORTER_NOLINE(ASC_USER_SUCCESS,"success"); }
The next 'error_reporter' call after an outermost 'error_reporter_tree_end' will cause the error tree to be output to the error reporting channel.
If an 'error_reporter' is found *inside* an an 'error_reporter_tree_start' and 'error_reporter_tree_end', the error message is kept and not output.
If the latest set of errors (those found inside the last start..end) are not important, they can be discarded using error_reporter_tree_clear. This will not clear the entire error tree, as there may be errors higher-up that we don't want to discard.
After a call to error_reporter_tree_clear(), further errors can still be added within the current TREECURRENT context.
Data Fields | |
| error_reporter_meta_t * | err |
| ErrorReporterTree * | head |
| ErrorReporterTree * | tail |
| ErrorReporterTree * | next |
| ErrorReporterTree * | parent |
first on the list of child errors
last on the list of child errors
next error in the present list
parent error (or NULL)
1.5.1