From f9f8052f0909158736794dd0f6907e0c13120b79 Mon Sep 17 00:00:00 2001 From: auria Date: Thu, 22 Dec 2011 21:01:17 +0000 Subject: [PATCH] Improve error handling in string utils git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10481 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/utils/string_utils.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils/string_utils.cpp b/src/utils/string_utils.cpp index 515da677f..a732cc238 100644 --- a/src/utils/string_utils.cpp +++ b/src/utils/string_utils.cpp @@ -166,10 +166,9 @@ namespace StringUtils } catch (std::exception& e) { - (void)e; // avoid warning message about unused variable fprintf(stderr, - "Fatal error in split(std::string) : %s @ line %i\n", - __FILE__, __LINE__); + "Fatal error in split(std::string) : %s @ line %i : %s\n", + __FILE__, __LINE__, e.what()); printf("Splitting %s\n", s.c_str()); for (int n=0; n<(int)result.size(); n++) @@ -177,6 +176,7 @@ namespace StringUtils printf("Split : %s\n", result[n].c_str()); } + assert(false); // in debug mode, trigger debugger exit(1); } } // split @@ -229,8 +229,9 @@ namespace StringUtils { (void)e; // avoid warning about unused variable fprintf(stderr, - "Fatal error in split(stringw) : %s @ line %i\n", - __FILE__, __LINE__); + "Fatal error in split(stringw) : %s @ line %i : %s\n", + __FILE__, __LINE__, e.what()); + assert(false); // in dbug mode, trigger debugger exit(1); } } // split