Author Topic: [31def0dc1a] Run time errors need to be handled better (more visible)  (Read 942 times)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
I could have sworn that we used to do a better job at handling run time errors (although I may be thinking of GAE; it's been a while).

By run time error, I'm referring particularly to errors in validating tech trees. Right now, they crash the program and don't print to the log. The error log has not been touched. The regular log just cuts off at the unit where the error was thrown. In order to retrieve the error message, you must run the game from the console (so that the console won't close when the program closes).

And even then, the error messages are heavily overcomplicated (for whatever reason) and the simple message is concealed within two dozen lines of "stack traces" (and I put this in quotes because it's not a stack trace I've seen before and doesn't seem to be useful in any way). This may be related to the other issues that I pointed out today, namely that Windows won't compile unless an exception handling line is commented out and that the debugging files are output in the wrong name.

Below is the error of the simple mistake of using an invalid armor type on a single unit.

Code: [Select]
$ megaglest.exe
megaglest.exe v3.10.0-dev
Compiled using: VC++: 1600 [DEBUG] on: Jul 19 2014 07:40:38 platform: Windows endianness: little
GIT: [$Rev$] - using STREFLOP [SSE] - [no-denormals]
*ERROR* [2014-07-19 10:06:38] In [unit_type.cpp::Glest::Game::UnitType::loaddd Line: 727] Error [Arm
or Type not found: asd
Stack Trace:
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18
]
*ERROR* [2014-07-19 10:06:38] In [faction_type.cpp::Glest::Game::FactionType::load Line: 185] Error
[Error loading UnitType: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game\techs/mega
pack/factions/indian/units/stickfighter/stickfighter.xml
Message: Armor Type not found: asd
Stack Trace:
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18
]
*ERROR* [2014-07-19 10:06:38] In [tech_tree.cpp::Glest::Game::TechTree::load Line: 357] Error [Error
 loading units: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game\techs/megapack/fact
ions/indian/
Message: Error loading UnitType: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game\te
chs/megapack/factions/indian/units/stickfighter/stickfighter.xml
Message: Armor Type not found: asd
Stack Trace:
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809ae0d NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809ae0d NtGetContextThread!ntdll (null)(0) +18
]
*ERROR* [2014-07-19 10:06:39] In [program.cpp::Glest::Game::Program::setState Line: 683]
Error [Error loading Faction Types: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game
\techs/megapack/
Message: Error loading units: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game\techs
/megapack/factions/indian/
Message: Error loading UnitType: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game\te
chs/megapack/factions/indian/units/stickfighter/stickfighter.xml
Message: Armor Type not found: asd
Stack Trace:
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809ae0d NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809ae0d NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809b615 NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809b615 NtGetContextThread!ntdll (null)(0) +18
]
AL lib: ReleaseALC: 1 device not closed
« Last Edit: 19 July 2014, 19:52:40 by Omega »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
I agree if it is possible then the most interesting part should be on the beginning or on the end, not somewhere in the middle of "useless numbers".