---
name: "std::system_error"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::system_error/3cxx"
---

# std::system\_error(3cxx)

An exception type that includes an error\_code value.

## NAME

std::system\_error - An exception type that includes an `error_code` value.

## SYNOPSIS

`#include <system_error>`

Inherits **std::runtime\_error**.

Inherited by **std::experimental::filesystem::v1::filesystem\_error**, and **std::filesystem::filesystem\_error**.

### Public Member Functions

**system\_error** (const **system\_error** &)=**default**\
 **system\_error** (**error\_code** **\_\_ec**, const char \***\_\_what**)\
 **system\_error** (**error\_code** **\_\_ec**, const **string** &**\_\_what**)\
 **system\_error** (**error\_code** **\_\_ec**=**error\_code**())\
 **system\_error** (int **\_\_v**, const **error\_category** &**\_\_ecat**)\
 **system\_error** (int **\_\_v**, const **error\_category** &**\_\_ecat**, const char \***\_\_what**)\
 **system\_error** (int **\_\_v**, const **error\_category** &**\_\_ecat**, const **string** &**\_\_what**)\
 const **error\_code** & **code** () const noexcept\
 **system\_error** & **operator=** (const **system\_error** &)=**default**\
 **virtual** const char \* **what** () const noexcept\

## Detailed Description

An exception type that includes an `error_code` value.

Typically used to report errors from the operating system and other low-level APIs.

**Since**

C++11

## Member Function Documentation

### virtual const char \* std::runtime\_error::what () const` [virtual]`, ` [noexcept]`, ` [inherited]`

Returns a C-style character string describing the general cause of the current error (the same string passed to the ctor). \

Reimplemented from **std::exception**.

Reimplemented in **std::filesystem::filesystem\_error**, and **std::experimental::filesystem::v1::filesystem\_error**.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
