Error handling
Da cppreference.com
< cpp
![]() | This page has been machine-translated from the English version of the wiki using Google Translate. The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
[editar]Manipulação de exceção
O
<exception>
cabeçalho fornece várias classes e funções relacionadas com o tratamento de exceções em C + +.Original:
The header
<exception>
provides several classes and functions related to exception handling in C++ programs.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <exception> | |
classe base para exceções lançadas pelos componentes da biblioteca padrão Original: base class for exceptions thrown by the standard library components The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
Original: Capture and storage of exception objects The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
verifica se o tratamento de exceção está em andamento Original: checks if exception handling is currently in progress The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) | |
(C++11) | tipo ponteiro compartilhado para manusear objetos de exceção Original: shared pointer type for handling exception objects The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) |
(C++11) | cria uma std::exception_ptr a partir de um objeto de exceção Original: creates an std::exception_ptr from an exception object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) |
(C++11) | captures the current exception in a std::exception_ptr (função) |
(C++11) | lança a exceção de um std::exception_ptr Original: throws the exception from an std::exception_ptr The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) |
(C++11) | um tipo mixin para capturar e armazenar as exceções atuais Original: a mixin type to capture and store current exceptions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) | lança seu argumento com std::nested_exception misturado polegadas Original: throws its argument with std::nested_exception mixed in The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) |
(C++11) | lança a exceção de um std::nested_exception Original: throws the exception from a std::nested_exception The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) |
Original: Handling of failures in exception handling The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
função chamada quando o tratamento de exceção falha Original: function called when exception handling fails The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) | |
o tipo da função de chamada por std::terminate Original: the type of the function called by std::terminate The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) | |
(C++11) | obtém o terminate_handler actual Original: obtains the current terminate_handler The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) |
alterações da função a ser chamado por std::terminate Original: changes the function to be called by std::terminate The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) | |
Original: Handling of exception specification violations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(obsoleta) | função chamada quando especificação de exceção dinâmica é violada Original: function called when dynamic exception specification is violated The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) |
exceção lançada quando especificação de exceção dinâmica é violado, se possível Original: exception thrown when dynamic exception specification is violated, if possible The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
(obsoleta) | o tipo da função de chamada por std::unexpected Original: the type of the function called by std::unexpected The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) |
(C++11)(obsoleta) | obtém o unexpected_handler actual Original: obtains the current unexpected_handler The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) |
(obsoleta) | alterações da função a ser chamado por std::unexpected Original: changes the function to be called by std::unexpected The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) |
[editar]Categorias de exceção
Várias classes de conveniência são predefinidas no
<stdexcept>
cabeçalho para relatar condições de erro em particular. Essas classes podem ser divididos em duas categorias: erros lógicos' e erros de execução'. Erros de lógica são uma consequência da falta de lógica dentro do programa e podem ser prevenidas. Erros de execução são devido a eventos fora do escopo do programa e não pode ser facilmente previsível.Original:
Several convenience classes are predefined in the header
<stdexcept>
to report particular error conditions. These classes can be divided into two categories: logic errors and runtime errors. Logic errors are a consequence of faulty logic within the program and may be preventable. Runtime errors are due to events beyond the scope of the program and can not be easily predicted.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <stdexcept> | |
classe de exceção para indicar violações dos pressupostos lógicos ou invariantes de classe Original: exception class to indicate violations of logical preconditions or class invariants The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe de exceção para relatar argumentos inválidos Original: exception class to report invalid arguments The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe de exceção para relatar erros de domínio Original: exception class to report domain errors The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe de exceção para relatar tentativas de ultrapassar o tamanho máximo permitido Original: exception class to report attempts to exceed maximum allowed size The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe de exceção para relatar argumentos fora do intervalo esperado Original: exception class to report arguments outside of expected range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe de exceção para indicar condições detectáveis apenas em tempo de execução Original: exception class to indicate conditions only detectable at run time The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe de exceção para relatar erros de alcance em cálculos internos Original: exception class to report range errors in internal computations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe de exceção para relatar transborda aritméticas Original: exception class to report arithmetic overflows The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
classe de exceção para relatar underflows aritméticas Original: exception class to report arithmetic underflows The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
[editar]Os números de erro
Defined in header <cerrno> | |
macro que se expande para POSIX compatível variable (variável macro) número de segmento local de erro Original: macro which expands to POSIX-compatible thread-local error number variable (variável macro) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
macros para condições normais POSIX-compatíveis erro Original: macros for standard POSIX-compatible error conditions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (macro constante) |
[editar]Afirmações
Afirmações ajudar a implementar a verificação de pré-condições em programas.
Original:
Assertions help to implement checking of preconditions in programs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
afirmação estática | realiza em tempo de compilação afirmação verificando (desde C++11) Original: performs compile-time assertion checking (desde C++11) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Defined in header <cassert> | |
aborta o programa, se a condição especificada pelo usuário não é true. Pode ser desativado para compilações Original: aborts the program if the user-specified condition is not true. May be disabled for release builds The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função macro) |
[editar]Erro do sistema
O cabeçalho
<system_error>
define tipos e funções usadas para relatar condições de erro provenientes do sistema operacional, os fluxos de I / O, std::future, ou APIs de baixo nível de outros.Original:
The header
<system_error>
defines types and functions used to report error conditions originating from the operating system, streams I/O, std::future, or other low-level APIs.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <system_error> | |
(C++11) | classe base para as categorias de erro Original: base class for error categories The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) | identifica a categoria de erro genérico Original: identifies the generic error category The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) |
(C++11) | identifica a categoria de erro do sistema operacional Original: identifies the operating system error category The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) |
(C++11) | possui um código de erro portátil Original: holds a portable error code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) | enumeração std::error_condition listando todos os padrões <cerrno> constantes macroOriginal: the std::error_condition enumeration listing all standard <cerrno> macro constantsThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) | possui um código de erro depende da plataforma Original: holds a platform-dependent error code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) | classe de exceção utilizada para reportar as condições que têm um error_code Original: exception class used to report conditions that have an error_code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |