Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10269 for code/trunk/src


Ignore:
Timestamp:
Feb 14, 2015, 12:51:14 PM (9 years ago)
Author:
muemart
Message:

Tweak the xml error message a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/Loader.cc

    r10265 r10269  
    237237            orxout(user_error, context::loader) << endl;
    238238            orxout(user_error, context::loader) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ':' << endl;
    239             orxout(user_error, context::loader) << ex.what() << endl;
    240             orxout(user_error, context::loader) << "Loading aborted." << endl;
     239            OutputLevel ticpplevel = user_error;
    241240            if (lineTrace->size() > 0)
    242241            {
     242                ticpplevel = internal_error;
    243243                //Extract the line number from the exception
    244244                std::string tempstring(ex.what());
     
    252252                    {
    253253                        std::vector<std::pair<std::string, size_t> > linesources = lineTrace->at(line - 1);
    254                         orxout(user_error, context::loader) << "Line contains data from:" << endl;
     254                        std::ostringstream message;
     255                        message << "Possible sources of error:" << endl;
    255256                        for (std::vector<std::pair<std::string, size_t> >::iterator it = linesources.begin(); it != linesources.end(); ++it)
    256257                        {
    257                             orxout(user_error, context::loader) << it->first << " , Line " << it->second << endl;
    258                         }                       
     258                            message << it->first << ", Line " << it->second << endl;
     259                        }
     260                        orxout(user_error, context::loader) << message.str() << endl;
    259261                    }
    260262                }
    261263            }
     264            orxout(ticpplevel, context::loader) << ex.what() << endl;
     265            orxout(user_error, context::loader) << "Loading aborted." << endl;
    262266        }
    263267        catch (Exception& ex)
     
    283287        outfile.flush();
    284288        outfile.close();
    285         orxout(user_error, context::loader) << "The complete xml file has been saved to " << temppath << endl;
     289        orxout(internal_error, context::loader) << "The complete xml file has been saved to " << temppath << endl;
    286290#endif
    287291        return false;
Note: See TracChangeset for help on using the changeset viewer.