---
name: "Error"
section: "3"
platform: "linux"
package: "libvolpack1-dev"
version: "1.0b3-10"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Error"
---

# Error(3)

retrieve error codes

## NAME

vpGetError, vpGetErrorString - retrieve error codes

## SYNOPSIS

\#include \<volpack.h\>

vpResult

**vpGetError(***vpc***)**

-

  vpContext \**vpc;*

char \*

**vpGetErrorString(***code***)**

-

  vpResult *code;*

## ARGUMENTS

- *vpc*

  VolPack context from **vpCreateContext.**

- *code*

  A VolPack error result code.

## DESCRIPTION

These routines are used for error handling.  **vpGetError** return the error code from the first function call that failed since the last call to **vpGetError**.  **vpGetErrorString** returns a descriptive string corresponding to an error code.  The string is stored in a global array so it does not need to be copied to separate memory.

## ERRORS

**vpGetError** cannot fail.  A return value not equal to VP\_OK means that some previous function call has failed.  **vpGetErrorString** returns NULL if *code* **is invalid.**

## SEE ALSO

**[VolPack(3)](/VolPack/3.md), vpCreateContext(3)**
