Lingua

ExceptionHandling.SetUnhandledExceptionHandler Metodo

Definizione

Imposta un gestore per le eccezioni non gestite.

public:
 static void SetUnhandledExceptionHandler(Func<Exception ^, bool> ^ handler);
public static void SetUnhandledExceptionHandler(Func<Exception,bool> handler);
static member SetUnhandledExceptionHandler : Func<Exception, bool> -> unit
Public Shared Sub SetUnhandledExceptionHandler (handler As Func(Of Exception, Boolean))

Parametri

handler
Func<Exception,Boolean>

Callback richiamato per le eccezioni non gestite. Restituisce true se l'eccezione è stata gestita; in caso contrario, false.

Eccezioni

handler è null.

È già stato impostato un gestore.

Commenti

Il gestore verrà chiamato quando si verifica un'eccezione non gestita.

Il gestore deve restituire true se l'eccezione è stata gestita o false in caso contrario.

Se il gestore restituisce false, l'eccezione continuerà a propagarsi come non gestita.

Lo scopo di questo gestore è consentire all'utente di gestire normalmente le eccezioni non gestite quando il runtime viene usato in determinati scenari. Scenari come REPLs o scripting di gioco che ospitano plug-in non sono in grado di gestire eccezioni non gestite generate da tali plug-in.

Si applica a