Better displaying of errors/warning

Bug #1066331 reported by Matias Pino
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Armagetron Advanced
New
Wishlist
Unassigned

Bug Description

Replace the current

#define tERR_ERROR_INT(mess) { std::ostringstream s; s << "Internal error in " << __PRETTY_FUNCTION__ << " in " << __FILE__<< ':' << __LINE__ << " : \n \t" << mess << "\nPlease send a Bug report!" << '\0'; st_PresentError( "Internal Error", s.str().c_str() );}

#define tERR_ERROR(mess) { std::ostringstream s; s << "Error in " << __PRETTY_FUNCTION__ << " in " << __FILE__<< ':' << __LINE__ << " : \n \t" << mess << '\n'; st_PresentError( "Error", s.str().c_str() ); }

#define tERR_MESSAGE(mess) { std::ostringstream s; s << "Message from " << __PRETTY_FUNCTION__ << " in " << __FILE__<< ':' << __LINE__ << " : \n \t" << mess << '\n'; st_PresentMessage( "Message", s.str().c_str() ); }

#define tERR_WARN(mess) {con << "Warning in " << __PRETTY_FUNCTION__ << " in " << __FILE__<< ':' << __LINE__ << " : \n \t" << mess << '\n';}

for something prettier. I tried to do something along https://gist.github.com/3880437 but kept finding issues (which i attribute to my poor C++ knowledge). There are a few things i wanted to do:

1. It shouldnt be displayed either on con or cerr, the message should be displayed in both places.
2. Captions are not really necessary, it ends up showing "Warning: warning in" or "Error: error in".
3. Use the DEBUG flag to show the __PRETTY_FUNCTION__/__FILE__/__LINE__ stuff or not; regular users dont really care in which line of which file the error originated.
4. Move the formatting to tError.cpp instead.
5. Add fatal error or include a "kill" flag to tERR_ERROR[_INT] as it is hardcoded to dont die (tError.cpp:60:st_PresentError()).
6. src/tools/tDirectories.cpp:1671: tERR_MESSAGE("Could not determine path to data files. Using defaults or command line arguments.\n"); <= this should be a warning instead of a message.

Changed in armagetronad:
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.