From: Ricardo Markiewicz Date: Sun, 30 Oct 2005 05:15:22 +0000 (+0000) Subject: Capturo excepcion al agregar una clave. X-Git-Tag: 1_0-pre2~27 X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/commitdiff_plain/1b0eeb678671fcdb63eacc94a828cfcac62b0fa3 Capturo excepcion al agregar una clave. --- diff --git a/viewer/main.cpp b/viewer/main.cpp index 3b89a38..f7e4d5d 100644 --- a/viewer/main.cpp +++ b/viewer/main.cpp @@ -134,7 +134,11 @@ void nuevo_arbol () double l = Random::Double (0.0f, 1.0f); std::cout << l << " >= " << paltas << std::endl; if (l >= paltas) { - tree->AddKey (c); + try { + tree->AddKey (c); + } catch (Exception *e) { + std::cout << "====== " << (std::string)c << e->Message () << std::endl; + } i++; } else { /* Tengo que borrar una clave entre 0 e "i" de la lista @@ -165,7 +169,11 @@ void nuevo_arbol () while (it != lst.end ()) { ClaveVariable c(*it); - tree->AddKey (c); + try { + tree->AddKey (c); + } catch (Exception *e) { + std::cout << "====== " << (std::string)c << e->Message () << std::endl; + } it++; } }