Namensräume
Varianten
Aktionen

std::system_error

Aus cppreference.com
< cpp‎ | error

 
 
 
Fehlerbehandlung
Exception Handling
Original:
Exception handling
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
exception
uncaught_exception
exception_ptr(C++11)
make_exception_ptr(C++11)
current_exception(C++11)
rethrow_exception(C++11)
nested_exception(C++11)
throw_with_nested(C++11)
rethrow_if_nested(C++11)
Ausnahmebehandlung Ausfälle
Original:
Exception handling failures
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
terminate
terminate_handler
get_terminate(C++11)
set_terminate
unexpected(veraltet)
bad_exception
unexpected_handler(veraltet)
get_unexpected(C++11)(veraltet)
set_unexpected(veraltet)
Exception Kategorien
Original:
Exception categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
logic_error
invalid_argument
domain_error
length_error
out_of_range
runtime_error
range_error
overflow_error
underflow_error
Fehlercodes
Original:
Error codes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Fehlercodes
errno
Assertions
Original:
Assertions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
assert
system_error Anlage
Original:
system_error facility
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
error_category(C++11)
generic_category(C++11)
system_category(C++11)
error_condition(C++11)
errc(C++11)
error_code(C++11)
system_error(C++11)
 
Defined in header <system_error>
class system_error;
(seit C++11)
std::system_error ist die Art der Ausnahme von verschiedenen Bibliotheksfunktionen (typischerweise die Funktionen, die eine Schnittstelle mit dem Betriebssystem Einrichtungen, z. B. der Konstruktor std::thread), wenn die Ausnahme eine zugehörige std::error_code zu meldenden braucht weist geworfen .
Original:
std::system_error is the type of the exception thrown by various library functions (typically the functions that interface with the OS facilities, e.g. the constructor of std::thread), when the exception has an associated std::error_code which needs to be reported.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cpp/error/exceptioncpp/error/runtime errorstd-system error-inheritance.svg
Über dieses Bild

Inheritance diagram

Inhaltsverzeichnis

[Bearbeiten] Member-Funktionen

baut die system_error Objekt
Original:
constructs the system_error object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(öffentliche Elementfunktion) [edit]
gibt den Fehlercode
Original:
returns error code
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(öffentliche Elementfunktion) [edit]
[virtuell]
kehrt erklärende String
Original:
returns explanatory string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtuellen öffentlichen Member-Funktion) [edit]

Inherited from std::exception

Member functions

[virtuell]
zerstört sich die Ausnahme-Objekt
Original:
destructs the exception object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtuellen öffentlichen Member-Funktion of std::exception) [edit]
[virtuell]
gibt einen erläuternden String
Original:
returns an explanatory string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtuellen öffentlichen Member-Funktion of std::exception) [edit]

[Bearbeiten] Beispiel

#include <thread>
#include <iostream>
#include <system_error>
 
int main()
{
    try {
        std::thread().detach(); // attempt to detach a non-thread
    } catch(const std::system_error& e) {
        std::cout << "Caught system_error with code " << e.code() 
                  << " meaning " << e.what() << '\n';
    }
}

Output:

Caught system_error with code generic:22 meaning Invalid argument