# CategoryError

Simple error message routines for SDL.

Most apps will interface with these APIs in exactly one function: when
almost any SDL function call reports failure, you can get a human-readable
string of the problem from [SDL_GetError](SDL_GetError)().

These strings are maintained per-thread, and apps are welcome to set their
own errors, which is popular when building libraries on top of SDL for
other apps to consume. These strings are set by calling
[SDL_SetError](SDL_SetError)().

A common usage pattern is to have a function that returns true for success
and false for failure, and do this when something fails:

```c
if (something_went_wrong) {
   return SDL_SetError("The thing broke in this specific way: %d", errcode);
}
```

It's also common to just return `false` in this case if the failing thing
is known to call [SDL_SetError](SDL_SetError)(), so errors simply propagate
through.

<!-- END CATEGORY DOCUMENTATION -->

## Functions

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategoryError, CategoryAPIFunction -->
- [SDL_ClearError](SDL_ClearError)
- [SDL_GetError](SDL_GetError)
- [SDL_OutOfMemory](SDL_OutOfMemory)
- [SDL_SetError](SDL_SetError)
- [SDL_SetErrorV](SDL_SetErrorV)
<!-- END CATEGORY LIST -->

## Datatypes

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategoryError, CategoryAPIDatatype -->
- (none.)
<!-- END CATEGORY LIST -->

## Structs

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategoryError, CategoryAPIStruct -->
- (none.)
<!-- END CATEGORY LIST -->

## Enums

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategoryError, CategoryAPIEnum -->
- (none.)
<!-- END CATEGORY LIST -->

## Macros

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategoryError, CategoryAPIMacro -->
- [SDL_InvalidParamError](SDL_InvalidParamError)
- [SDL_Unsupported](SDL_Unsupported)
<!-- END CATEGORY LIST -->

----
[CategoryAPICategory](CategoryAPICategory)

