Compartir a través de


Constructor COMException (String, Exception)

 

Publicado: octubre de 2016

Inicializa una nueva instancia de la clase COMException con el mensaje de error especificado y una referencia a la excepción interna que representa la causa de esta excepción.

Espacio de nombres:   System.Runtime.InteropServices
Ensamblado:  mscorlib (en mscorlib.dll)

Sintaxis

public COMException(
    string message,
    Exception inner
)
public:
COMException(
    String^ message,
    Exception^ inner
)
new : 
        message:string *
        inner:Exception -> COMException
Public Sub New (
    message As String,
    inner As Exception
)

Parámetros

  • message
    Type: System.String

    Mensaje de error que explica el motivo de la excepción.

  • inner
    Type: System.Exception

    Excepción que es la causa de la excepción actual. Si el parámetro inner no es null, la excepción actual se produce en un bloque catch que controla la excepción interna.

Comentarios

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the P:System.Exception.InnerException property. The P:System.Exception.InnerException property returns the same value that is passed into the constructor, or null if the P:System.Exception.InnerException property does not supply the inner exception value to the constructor.

The following table shows how this constructor sets the properties of the T:System.Exception object.

Property

Value

InnerException

The inner exception reference.

Message

The error message string.

Información de versión

Plataforma universal de Windows
Disponible desde 8
.NET Framework
Disponible desde 1.1
Biblioteca de clases portable
Se admite en: plataformas portátiles de .NET
Windows Phone
Disponible desde 8.1

Ver también

Exception
COMException Sobrecarga
Clase COMException
Espacio de nombres System.Runtime.InteropServices
Controlar y generar excepciones

Volver al principio