[Orxonox-commit 5607] r10269 - code/trunk/src/libraries/core

muemart at orxonox.net muemart at orxonox.net
Sat Feb 14 12:51:14 CET 2015


Author: muemart
Date: 2015-02-14 12:51:14 +0100 (Sat, 14 Feb 2015)
New Revision: 10269

Modified:
   code/trunk/src/libraries/core/Loader.cc
Log:
Tweak the xml error message a bit

Modified: code/trunk/src/libraries/core/Loader.cc
===================================================================
--- code/trunk/src/libraries/core/Loader.cc	2015-02-12 22:28:26 UTC (rev 10268)
+++ code/trunk/src/libraries/core/Loader.cc	2015-02-14 11:51:14 UTC (rev 10269)
@@ -236,10 +236,10 @@
         {
             orxout(user_error, context::loader) << endl;
             orxout(user_error, context::loader) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ':' << endl;
-            orxout(user_error, context::loader) << ex.what() << endl;
-            orxout(user_error, context::loader) << "Loading aborted." << endl;
+            OutputLevel ticpplevel = user_error;
             if (lineTrace->size() > 0)
             {
+                ticpplevel = internal_error;
                 //Extract the line number from the exception
                 std::string tempstring(ex.what());
                 std::string::size_type pos = tempstring.find("\nLine: ");
@@ -251,14 +251,18 @@
                     if (line <= lineTrace->size())
                     {
                         std::vector<std::pair<std::string, size_t> > linesources = lineTrace->at(line - 1);
-                        orxout(user_error, context::loader) << "Line contains data from:" << endl;
+                        std::ostringstream message;
+                        message << "Possible sources of error:" << endl;
                         for (std::vector<std::pair<std::string, size_t> >::iterator it = linesources.begin(); it != linesources.end(); ++it)
                         {
-                            orxout(user_error, context::loader) << it->first << " , Line " << it->second << endl;
-                        }                        
+                            message << it->first << ", Line " << it->second << endl;
+                        }
+                        orxout(user_error, context::loader) << message.str() << endl;
                     }
                 }
             }
+            orxout(ticpplevel, context::loader) << ex.what() << endl;
+            orxout(user_error, context::loader) << "Loading aborted." << endl;
         }
         catch (Exception& ex)
         {
@@ -282,7 +286,7 @@
         outfile << xmlInput;
         outfile.flush();
         outfile.close();
-        orxout(user_error, context::loader) << "The complete xml file has been saved to " << temppath << endl;
+        orxout(internal_error, context::loader) << "The complete xml file has been saved to " << temppath << endl;
 #endif
         return false;
     }




More information about the Orxonox-commit mailing list