Error handling
De 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] Manejo de excepciones
El
<exception>
encabezado proporciona varias clases y funciones relacionadas con el manejo de excepciones en 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.
Definido en la cabecera
<exception> | |
Clase base para excepciones producidas por los componentes de la biblioteca estándar 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. (clase) | |
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. | |
comprueba si el manejo de excepciones se encuentra actualmente en curso 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. (función) | |
(C++11) |
puntero compartido tipo para la manipulación de objetos de excepción 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) |
crea una std::exception_ptr de un objeto de excepción 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. (plantilla de función) |
(C++11) |
captures the current exception in a std::exception_ptr (función) |
(C++11) |
produce la excepción de un 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. (función) |
(C++11) |
un tipo mixin para capturar y almacenar las excepciones actuales 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. (clase) |
(C++11) |
hace gala de su discusión con std::nested_exception mezclarla 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. (plantilla de función) |
(C++11) |
produce la excepción de un 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. (plantilla de función) |
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. | |
función llamada cuando falla el control de excepciones 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. (función) | |
el tipo de la función llamada 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) |
obtiene el 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. (función) |
cambios en la función a ser llamada 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. (función) | |
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. | |
(obsoleto) |
función llamada cuando especificación de excepciones dinámica es 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. (función) |
Excepción que se produce cuando la especificación dinámica excepción es violada, si es posible 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. (clase) | |
(obsoleto) |
el tipo de la función llamada 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)(obsoleto) |
obtiene el 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. (función) |
(obsoleto) |
cambios en la función a ser llamada 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. (función) |
[editar] Categorías excepción
Varias clases de conveniencia están predefinidos en el
<stdexcept>
cabecera para informar de las condiciones particulares de error. Estas clases se pueden dividir en dos categorías: errores lógicos' y errores de tiempo de ejecución. Los errores lógicos son una consecuencia de la lógica defectuosa dentro del programa y se pueden prevenir. Los errores de ejecución se deben a eventos más allá del alcance del programa y no se puede predecir fácilmente .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.
Definido en la cabecera
<stdexcept> | |
clase de excepción para indicar violaciónes de condiciones lógicas o invariantes de clase 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. (clase) | |
excepción de clase reportar argumentos no vá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. (clase) | |
excepción de clase para informar de errores de dominio 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. (clase) | |
clase de excepción para reportar los intentos de superar el tamaño 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. (clase) | |
clase de excepción para informar argumentos fuera del rango 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. (clase) | |
clase de excepción para indicar condiciones sólo detectables en tiempo de ejecución 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. (clase) | |
clase de excepción para reportar errores de rango en los 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. (clase) | |
excepción de clase reportar desbordamientos aritméticos 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. (clase) | |
excepción de clase reportar el underflow 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. (clase) |
[editar] Números de error
Definido en la cabecera
<cerrno> | |
macro que se expande para POSIX compatible local de subprocesos variable
(variables macro) número de error Original: macro which expands to POSIX-compatible thread-local error number variable (variables 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 las condiciones de error estándar POSIX compatibles 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 de constante) |
[editar] Las afirmaciones
Las afirmaciones ayudan a poner en práctica la comprobación de requisitos previos en los 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.
afirmación estática | realiza en tiempo de compilación comprobación de aserciones (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. |
Definido en la cabecera
<cassert> | |
aborta el programa si la condición especificada por el usuario no es true. Puede ser desactivado para las versiones de lanzamiento 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. (macro de función) |
[editar] Error del sistema
La cabecera
<system_error>
define los tipos y funciones que se utilizan para informar sobre condiciones de error procedentes del sistema operativo, las corrientes I / O, std::future, u otras API de bajo nivel .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.
Definido en la cabecera
<system_error> | |
(C++11) |
clase base para las categorías de error 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. (clase) |
(C++11) |
identifica la categoría de error 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. (función) |
(C++11) |
identifica la categoría de error del sistema operativo 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. (función) |
(C++11) |
tiene un código de error 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. (clase) |
(C++11) |
la enumeración std::error_condition lista de todos los estándares <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. (clase) |
(C++11) |
tiene un código de error dependiente de la 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. (clase) |
(C++11) |
clase de excepción utilizado para informar de las condiciones que tienen un 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. (clase) |