From a814812bdabf3e0e8b1e6de82bd73b26b4c5ec9e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 6 Nov 2015 10:17:01 +0000 Subject: coverity#1338268 Uncaught exception Change-Id: Id954d556c2b65772025b8aaabdbfa9ed4ae7a9b7 --- l10ntools/source/localize.cxx | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'l10ntools/source') diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 5c107a6a3a6b..e12ffc014ee2 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -453,19 +453,29 @@ void handleProjects(char * sSourceRoot, char const * sDestRoot) } } -SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { - if (argc != 3) { - cerr - << ("localize (c)2001 by Sun Microsystems\n\n" - "As part of the L10N framework, localize extracts en-US\n" - "strings for translation out of the toplevel modules defined\n" - "in projects array in l10ntools/source/localize.cxx.\n\n" - "Syntax: localize \n"); - exit(EXIT_FAILURE); - } - try { +SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) +{ + try + { + if (argc != 3) + { + cerr + << ("localize (c)2001 by Sun Microsystems\n\n" + "As part of the L10N framework, localize extracts en-US\n" + "strings for translation out of the toplevel modules defined\n" + "in projects array in l10ntools/source/localize.cxx.\n\n" + "Syntax: localize \n"); + exit(EXIT_FAILURE); + } handleProjects(argv[1],argv[2]); - } catch (bool) { //TODO + } + catch (std::exception& e) + { + cerr << "exception: " << e.what() << std::endl; + return EXIT_FAILURE; + } + catch (bool) //TODO + { return EXIT_FAILURE; } return EXIT_SUCCESS; -- cgit