Documentation Home >> Headers >> <system_error> Header >> std::system_error class

The std::system_error class is intended for use as an exception type, thrown by functions that may fail due to errors reported by the underlying operating system.

class system_error:
    public std::runtime_error
{
public:
    system_error(
        error_code ec, const std::string& what_arg);
    system_error(error_code ec, const char* what_arg);
    system_error(error_code ec);
    system_error(int ev, const error_category& ecat,
                 const std::string& what_arg);
    system_error(int ev, const error_category& ecat,
                 const char* what_arg);
    system_error(int ev, const error_category& ecat);

    const error_code& code() const throw();

    const char* what() const throw();
};
Header

#include <system_error>

See Also