From: Adam Dickmeiss Date: Thu, 19 Jan 2006 09:32:08 +0000 (+0000) Subject: Catch exceptions a little better for yp2 program X-Git-Tag: YP2.0.0.3~22 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=41fbc58001c48cbea3715eddb8a0526b59a24392;p=metaproxy-moved-to-github.git Catch exceptions a little better for yp2 program --- diff --git a/src/yp2_prog.cpp b/src/yp2_prog.cpp index 244f3b0..4109c86 100644 --- a/src/yp2_prog.cpp +++ b/src/yp2_prog.cpp @@ -1,4 +1,4 @@ -/* $Id: yp2_prog.cpp,v 1.1 2006-01-16 11:22:56 adam Exp $ +/* $Id: yp2_prog.cpp,v 1.2 2006-01-19 09:32:08 adam Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -66,19 +66,21 @@ int main(int argc, char **argv) } if (doc) { - yp2::FactoryStatic factory; - yp2::RouterFleXML router(doc, factory); - - yp2::Package pack; - - pack.router(router).move(); - + try { + yp2::FactoryStatic factory; + yp2::RouterFleXML router(doc, factory); + yp2::Package pack; + pack.router(router).move(); + } + catch (std::runtime_error &e) { + std::cout << "std::runtime error: " << e.what() << "\n"; + exit(1); + } xmlFreeDoc(doc); } } catch ( ... ) { std::cerr << "Unknown Exception" << std::endl; - throw; std::exit(1); } std::exit(0);