.TH "globus_error_generic.h" 3 "Version 18.14" "globus_common" \" -*- nroff -*-
.ad l
.nh
.SH NAME
globus_error_generic.h \- Globus Error API\&.  

.SH SYNOPSIS
.br
.PP
\fC#include 'globus_object\&.h'\fP
.br
\fC#include 'globus_module\&.h'\fP
.br
\fC#include <stdarg\&.h>\fP
.br

.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBGLOBUS_ERROR_TYPE_GLOBUS\fP"
.br
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef char *(* \fBglobus_error_print_friendly_t\fP) (globus_object_t *error, const globus_object_type_t *type)"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "\fBglobus_module_descriptor_t\fP * \fBglobus_error_get_source\fP (globus_object_t *error)"
.br
.ti -1c
.RI "void \fBglobus_error_set_source\fP (globus_object_t *error, \fBglobus_module_descriptor_t\fP *source_module)"
.br
.ti -1c
.RI "globus_object_t * \fBglobus_error_get_cause\fP (globus_object_t *error)"
.br
.ti -1c
.RI "void \fBglobus_error_set_cause\fP (globus_object_t *error, globus_object_t *causal_error)"
.br
.ti -1c
.RI "int \fBglobus_error_get_type\fP (globus_object_t *error)"
.br
.ti -1c
.RI "void \fBglobus_error_set_type\fP (globus_object_t *error, const int type)"
.br
.ti -1c
.RI "char * \fBglobus_error_get_short_desc\fP (globus_object_t *error)"
.br
.ti -1c
.RI "void \fBglobus_error_set_short_desc\fP (globus_object_t *error, const char *short_desc_format,\&.\&.\&.)"
.br
.ti -1c
.RI "char * \fBglobus_error_get_long_desc\fP (globus_object_t *error)"
.br
.ti -1c
.RI "void \fBglobus_error_set_long_desc\fP (globus_object_t *error, const char *long_desc_format,\&.\&.\&.)"
.br
.ti -1c
.RI "\fBglobus_bool_t\fP \fBglobus_error_match\fP (globus_object_t *error, \fBglobus_module_descriptor_t\fP *module, int type)"
.br
.ti -1c
.RI "char * \fBglobus_error_print_chain\fP (globus_object_t *error)"
.br
.ti -1c
.RI "char * \fBglobus_error_print_friendly\fP (globus_object_t *error)"
.br
.ti -1c
.RI "globus_object_t * \fBglobus_error_construct_multiple\fP (\fBglobus_module_descriptor_t\fP *base_source, int type, const char *fmt,\&.\&.\&.)"
.br
.ti -1c
.RI "void \fBglobus_error_mutliple_add_chain\fP (globus_object_t *multiple_error, globus_object_t *chain, const char *fmt,\&.\&.\&.)"
.br
.ti -1c
.RI "globus_object_t * \fBglobus_error_multiple_remove_chain\fP (globus_object_t *multiple_error)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Globus Error API\&. 


.SH "Typedef Documentation"
.PP 
.SS "typedef char *(* globus_error_print_friendly_t) (globus_object_t *error, const globus_object_type_t *type)"
If registered with a module's descriptor, this handler will be called on behalf of \fBglobus_error_print_friendly()\fP
.PP
\fBParameters\fP
.RS 4
\fIerror\fP The error chain that originated from this module\&. The top error object in the chain will be one created by this module and have a type of 'type'; The remaining objects are the same as the cause chain used at creation time\&. The user can use globus_error_get_type(error) to get the error code (for GLOBUS_ERROR_TYPE_GLOBUS objects)
.br
\fItype\fP The error object type for the top object in the error chain (e\&.g\&. GLOBUS_ERROR_TYPE_GLOBUS, GLOBUS_ERROR_TYPE_ERRNO)
.RE
.PP
\fBReturns\fP
.RS 4
The function should return a newly allocated string with a friendly error message explaining the error in more detail\&. This string should be considered the only message a user will see\&. If the module has nothing nice to say, it should return NULL so the next module in the error chain can be tried\&.
.RE
.PP
If you think a friendly error from causes beneath you should be included, you may use globus_error_print_friendly(globus_error_get_cause(error)) within this handler to append to your message\&. 
.SH "Function Documentation"
.PP 
.SS "globus_object_t * globus_error_construct_multiple (\fBglobus_module_descriptor_t\fP * base_source, int type, const char * fmt,  \&.\&.\&.)"
Multiple error type stuff Construct a container object for multiple error chains\&. Useful when an application tries many things (and each fails) before finally giving up;
.PP
Use globus_error_mutliple_add_chain() to add error objects/chains to this object\&.
.PP
\fBParameters\fP
.RS 4
\fIbase_source\fP Pointer to the originating module\&. 
.br
\fItype\fP The error type\&. We may reserve part of this namespace for common errors\&. Errors not in this space are assumed to be local to the originating module\&. \fBglobus_error_match()\fP will match against this type, but not of the contained chains\&. 
.br
\fIfmt\fP a printf style format string describing the multiple errors 
.RE
.PP
\fBReturns\fP
.RS 4
The resulting error object\&. It is the user's responsibility to eventually free this object using globus_object_free()\&. A globus_result_t may be obtained by calling globus_error_put() on this object\&. 
.br
 
.RE
.PP

.SS "globus_object_t * globus_error_multiple_remove_chain (globus_object_t * multiple_error)"
Remove an error chain from a multiple error object\&.
.PP
\fBParameters\fP
.RS 4
\fImultiple_error\fP The error from which to remove a chain\&. Must have been created with globus_error_construct_multiple() 
.RE
.PP
\fBReturns\fP
.RS 4
The removed error chain, or NULL if none found\&. 
.RE
.PP

.SS "void globus_error_mutliple_add_chain (globus_object_t * multiple_error, globus_object_t * chain, const char * fmt,  \&.\&.\&.)"
Add an error chain to a multiple error object\&.
.PP
\fBParameters\fP
.RS 4
\fImultiple_error\fP The error to add the chain to\&. Must have been created with globus_error_construct_multiple() 
.br
\fIchain\fP The chain to add to this error\&. This error object assumes control over 'chain''s memory after this call\&. 
.br
\fIfmt\fP a printf style format string describing this chain 
.RE
.PP
\fBReturns\fP
.RS 4
void 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for globus_common from the source code\&.
