---
name: "globus_gram_protocol_error_7_hack_replace_message"
section: "3"
platform: "linux"
package: "libglobus-gram-protocol-doc"
version: "13.6-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_gram_protocol_error_messages"
---

# globus\_gram\_protocol\_error\_7\_hack\_replace\_message(3)

Error Messages - GRAM Error Messages.

Part of [globus\_gram\_protocol\_error\_messages(3)](/globus_gram_protocol_error_messages/3.md).

## NAME

globus\_gram\_protocol\_error\_messages - Error Messages

 \- GRAM Error Messages.

## SYNOPSIS

### Functions

const char \* **globus\_gram\_protocol\_error\_string** (int error\_code)\
 Get a description of a a GRAM error code.  void **globus\_gram\_protocol\_error\_7\_hack\_replace\_message** (const char \*message)\
 Replace the error message associated with error 7 with a custom message.  void **globus\_gram\_protocol\_error\_10\_hack\_replace\_message** (const char \*message)\
 Replace the error message associated with error 10 with a custom message.

## Detailed Description

GRAM Error Messages.

Functions in this section handle converting GRAM error codes to strings which can help the user diagnose GRAM problems.

## Function Documentation

### void globus\_gram\_protocol\_error\_10\_hack\_replace\_message (const char \* message)

Replace the error message associated with error 10 with a custom message. The **globus\_gram\_protocol\_error\_10\_hack\_replace\_message()** function creates a custom version of the error message for the error *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_PROTOCOL\_FAILED*. The string pointed to by the *message* parameter is copied to thread-local storage, and subsequent calls to **globus\_gram\_protocol\_error\_string()** with this error number will return this copy of the string. Each time **globus\_gram\_protocol\_error\_10\_hack\_replace\_message()** is called for a particular thread, the previous message is freed.

The purpose of this function is to allow more meaningful error messages to be generated when protocol errors occur. In particular, the specific XIO error reason can be used in place of a generic protocol failure message.

**Parameters**

*message* The new message to be associated with the GLOBUS\_GRAM\_PROTOCOL\_ERROR\_PROTOCOL\_FAILED error code.

**Note**

Since Globus 5.0.0, this function uses thread-specific storage, so that the value returned by **globus\_gram\_protocol\_error\_string()** for GLOBUS\_GRAM\_PROTOCOL\_ERROR\_PROTOCOL\_FAILED is that for the last authorization error where **globus\_gram\_protocol\_error\_10\_hack\_replace\_message()** was called from this thread.

### void globus\_gram\_protocol\_error\_7\_hack\_replace\_message (const char \* message)

Replace the error message associated with error 7 with a custom message. The **globus\_gram\_protocol\_error\_7\_hack\_replace\_message()** function creates a custom version of the error message for the error *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_AUTHORIZATION*. The string pointed to by the *message* parameter is copied to thread-local storage, and subsequent calls to **globus\_gram\_protocol\_error\_string()** with this error number will return this copy of the string. Each time **globus\_gram\_protocol\_error\_7\_hack\_replace\_message()** is called for a particular thread, the previous message is freed.

The purpose of this function is to allow more meaningful error messages to be generated when authentication failures occur. In particular, the specific GSSAPI error reason can be used in place of a generic authorization failure message.

**Parameters**

*message* The new message to be associated with the GLOBUS\_GRAM\_PROTOCOL\_ERROR\_AUTHORIZATION error code.

**Note**

Since Globus 5.0.0, this function uses thread-specific storage, so that the value returned by **globus\_gram\_protocol\_error\_string()** for GLOBUS\_GRAM\_PROTOCOL\_ERROR\_AUTHORIZATION is that for the last authorization error where **globus\_gram\_protocol\_error\_7\_hack\_replace\_message()** was called from this thread.

### const char \* globus\_gram\_protocol\_error\_string (int error\_code)

Get a description of a a GRAM error code. The **globus\_gram\_protocol\_error\_string()** function takes a GRAM error code value and returns the associated error code string for the message. The string is statically allocated by the GRAM Protocol library and should not be modified or freed by the caller. The string is intended to complete a sentence of the form '\[operation\] failed because ...'

**Parameters**

*error\_code* The error code to translate into a string.

**Returns**

The **globus\_gram\_protocol\_error\_string()** function returns a static string containing an explanation of the error.

## Author

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