system_error Class

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Represents the base class for all exceptions thrown to report a low-level system error.

class system_error : public runtime_error {  
public:  
    explicit system_error(error_code _Errcode,
    const string& _Message = "");

    system_error(error_code _Errcode,
    const char *_Message);

    system_error(error_code::value_type _Errval,  
    const error_category& _Errcat,
    const string& _Message);

    system_error(error_code::value_type _Errval,  
    const error_category& _Errcat,
    const char *_Message);
const error_code& code() const throw();
const error_code& code() const throw();

 };  

The value returned by what in the class exception is constructed from _Message and the stored object of type error_code (either code or error_code(_Errval, _Errcat)).

The member function code returns the stored error_code object.

Header: <system_error>

Namespace: std

<system_error>

Show: