Condividi tramite


Errore del compilatore C2317

blocco 'try' con inizio alla riga 'number' senza gestori catch

Osservazioni:

Un blocco try deve avere almeno un gestore catch.

Example

L'esempio seguente genera l'errore C2317:

// C2317.cpp
// compile with: /EHsc
#include <eh.h>
int main() {
   try {
      throw "throw an exception";
   }
   // C2317, no catch handler
}

Possibile soluzione:

// C2317b.cpp
// compile with: /EHsc
#include <eh.h>
int main() {
   try {
      throw "throw an exception";
   }
   catch(char*) {}
}