2020-05-30 09:36 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000587Spring engineGeneralpublic2007-08-15 23:55
Reportermalric 
Assigned Toimbaczek 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000587: Unclear error reporting (with patch)
DescriptionIf the start script contains a bad Mapname (for example empty) there will be a crash dialog but very unclear.

The patch displays a human understandable message. ("CreadMap::GetTDFName : mapname too short").

(this is trivial but I think it is good programming practice to report errors - and it annoyed me for some minutes)
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon vms_spring_map_error.patch (804 bytes) 2007-08-15 22:44 -
    Index: rts/Map/ReadMap.cpp
    ===================================================================
    --- rts/Map/ReadMap.cpp	(revision 4119)
    +++ rts/Map/ReadMap.cpp	(working copy)
    @@ -50,7 +50,9 @@
     
     std::string CReadMap::GetTDFName(const std::string& mapname)
     {
    +	if(mapname.length()<3) throw std::runtime_error("CreadMap::GetTDFName : mapname too short");
     	string extension = mapname.substr(mapname.length()-3);
    +	
     	if (extension == "smf") 
     		return string("maps/")+mapname.substr(0,mapname.find_last_of('.'))+".smd";
     	else if(extension == "sm3")
    @@ -61,6 +63,7 @@
     
     CReadMap* CReadMap::LoadMap (const std::string& mapname)
     {
    +	if(mapname.length()<3) throw std::runtime_error("CreadMap::GetTDFName : mapname too short");
     	string extension = mapname.substr(mapname.length()-3);
     
     	CReadMap *rm = 0;
    
    patch file icon vms_spring_map_error.patch (804 bytes) 2007-08-15 22:44 +

-Relationships
+Relationships

-Notes

~0001107

imbaczek (reporter)

committed a modified version in r4206.
+Notes

-Issue History
Date Modified Username Field Change
2007-08-15 22:44 malric New Issue
2007-08-15 22:44 malric File Added: vms_spring_map_error.patch
2007-08-15 23:55 imbaczek Status new => resolved
2007-08-15 23:55 imbaczek Resolution open => fixed
2007-08-15 23:55 imbaczek Assigned To => imbaczek
2007-08-15 23:55 imbaczek Note Added: 0001107
+Issue History