Metodo Expr.TryWith (F#)

Consente di creare un'espressione che rappresenta un costrutto try...with per il filtraggio e l'intercettazione delle eccezioni.

Percorso spazio dei nomi/modulo: Microsoft.FSharp.Quotations

Assembly: FSharp.Core (in FSharp.Core.dll)

// Signature:
static member TryWith : Expr * Var * Expr * Var * Expr -> Expr

// Usage:
Expr.TryWith (body, filterVar, filterBody, catchVar, catchBody)

Parametri

  • body
    Tipo: Expr

    Corpo dell'espressione try.

  • filterVar
    Tipo: Var

  • filterBody
    Tipo: Expr

  • catchVar
    Tipo: Var

    La variabile per ottenere un'associazione a un'eccezione intercettata.

  • catchBody
    Tipo: Expr

    Espressione valutata quando viene intercettata un'eccezione.

Valore restituito

Espressione risultante.

Piattaforme

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Informazioni sulla versione

Versioni della libreria di base F#

Supportato in: 2,0, 4,0, portabile

Vedere anche

Riferimenti

Classe Quotations.Expr (F#)

Spazio dei nomi Microsoft.FSharp.Quotations (F#)