---
name: "globus_generic_error_object"
section: "3"
platform: "linux"
package: "libglobus-common-doc"
version: "18.14-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_generic_error_object"
---

# globus\_generic\_error\_object(3)

Error Construction - Error Construction.

## NAME

globus\_generic\_error\_object - Error Construction

 \- Error Construction.

## SYNOPSIS

### Macros

\#define **GLOBUS\_ERROR\_TYPE\_GLOBUS**\

### Construct Error

globus\_object\_t \* **globus\_error\_construct\_error** (**globus\_module\_descriptor\_t** \*base\_source, globus\_object\_t \*base\_cause, int type, const char \*source\_file, const char \*source\_func, int source\_line, const char \*short\_desc\_format,...)\
 globus\_object\_t \* **globus\_error\_v\_construct\_error** (**globus\_module\_descriptor\_t** \*base\_source, globus\_object\_t \*base\_cause, const int type, const char \*source\_file, const char \*source\_func, int source\_line, const char \*short\_desc\_format, va\_list ap)\

### Initialize Error

globus\_object\_t \* **globus\_error\_initialize\_error** (globus\_object\_t \*error, **globus\_module\_descriptor\_t** \*base\_source, globus\_object\_t \*base\_cause, int type, const char \*source\_file, const char \*source\_func, int source\_line, const char \*short\_desc\_format, va\_list ap)\

## Detailed Description

Error Construction.

Create and initialize a Globus Generic Error object.

This section defines operations to create and initialize Globus Generic Error objects.

## Macro Definition Documentation

### #define GLOBUS\_ERROR\_TYPE\_GLOBUS

Error type definition

## Function Documentation

### globus\_object\_t \* globus\_error\_construct\_error (globus\_module\_descriptor\_t \* base\_source, globus\_object\_t \* base\_cause, int type, const char \* source\_file, const char \* source\_func, int source\_line, const char \* short\_desc\_format, ...)

Allocate and initialize an error of type GLOBUS\_ERROR\_TYPE\_GLOBUS

**Parameters**

*base\_source* Pointer to the originating module. \
 *base\_cause* The error object causing the error. If this is the original error this parameter may be NULL. \
 *type* 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. \
 *source\_file* Name of file. Use **FILE** \
 *source\_func* Name of function. Use \_globus\_func\_name and declare your func with GlobusFuncName(\<name\>) \
 *source\_line* Line number. Use **LINE** \
 *short\_desc\_format* Short format string giving a succinct description of the error. To be passed on to the user. \
 *...* Arguments for the format string.

**Returns**

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. \

### globus\_object\_t \* globus\_error\_initialize\_error (globus\_object\_t \* error, globus\_module\_descriptor\_t \* base\_source, globus\_object\_t \* base\_cause, int type, const char \* source\_file, const char \* source\_func, int source\_line, const char \* short\_desc\_format, va\_list ap)

Initialize a previously allocated error of type GLOBUS\_ERROR\_TYPE\_GLOBUS

**Parameters**

*error* The previously allocated error object. \
 *base\_source* Pointer to the originating module. \
 *base\_cause* The error object causing the error. If this is the original error this parameter may be NULL. \
 *type* 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. \
 *source\_file* Name of file. Use **FILE** \
 *source\_func* Name of function. Use \_globus\_func\_name and declare your func with GlobusFuncName(\<name\>) \
 *source\_line* Line number. Use **LINE** \
 *short\_desc\_format* Short format string giving a succinct description of the error. To be passed on to the user. \
 *ap* Arguments for the format string.

**Returns**

The resulting error object. You may have to call globus\_error\_put() on this object before passing it on.

### globus\_object\_t \* globus\_error\_v\_construct\_error (globus\_module\_descriptor\_t \* base\_source, globus\_object\_t \* base\_cause, const int type, const char \* source\_file, const char \* source\_func, int source\_line, const char \* short\_desc\_format, va\_list ap)

Allocate and initialize an error of type GLOBUS\_ERROR\_TYPE\_GLOBUS

**Parameters**

*base\_source* Pointer to the originating module. \
 *base\_cause* The error object causing the error. If this is the original error this parameter may be NULL. \
 *type* 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. \
 *source\_file* Name of file. Use **FILE** \
 *source\_func* Name of function. Use \_globus\_func\_name and declare your func with GlobusFuncName(\<name\>) \
 *source\_line* Line number. Use **LINE** \
 *short\_desc\_format* Short format string giving a succinct description of the error. To be passed on to the user. \
 *ap* Arguments for the format string.

**Returns**

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. \

## Author

Generated automatically by Doxygen for globus\_common from the source code.
