Index: ../../FlightGear/source/src/ATC/AIMgr.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/ATC/AIMgr.cxx,v retrieving revision 1.29 diff -b -u -p -r1.29 AIMgr.cxx --- ../../FlightGear/source/src/ATC/AIMgr.cxx 11 Nov 2005 13:45:35 -0000 1.29 +++ ../../FlightGear/source/src/ATC/AIMgr.cxx 25 Nov 2005 13:21:55 -0000 @@ -82,7 +82,7 @@ void FGAIMgr::init() { planepath.c_str(), globals->get_props(), globals->get_sim_time_sec() ); - } catch(sg_exception& e) { + } catch(sg_exception&) { _loadedDefaultOK = false; }
@@ -102,7 +102,7 @@ void FGAIMgr::init() { planepath.c_str(), globals->get_props(), globals->get_sim_time_sec() ); - } catch(sg_exception& e) { + } catch(sg_exception&) { _havePiperModel = false; } Index: ../../FlightGear/source/src/Environment/environment_ctrl.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Environment/environment_ctrl.cxx,v retrieving revision 1.40 diff -b -u -p -r1.40 environment_ctrl.cxx --- ../../FlightGear/source/src/Environment/environment_ctrl.cxx 22 Nov 2005 17:02:31 -0000 1.40 +++ ../../FlightGear/source/src/Environment/environment_ctrl.cxx 25 Nov 2005 13:21:57 -0000 @@ -572,9 +572,11 @@ FGMetarEnvironmentCtrl::fetch_data( cons result.m = NULL; if (++_stale_count > 10) { - _error_count = 1000; - throw sg_io_exception("More than 10 stale METAR messages in a row." + static sg_io_exception + Error("More than 10 stale METAR messages in a row." " Check your system time!"); + _error_count = 1000; + throw Error; } } else _stale_count = 0; Index: ../../FlightGear/source/src/Input/input.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Input/input.cxx,v retrieving revision 1.72 diff -b -u -p -r1.72 input.cxx --- ../../FlightGear/source/src/Input/input.cxx 23 Nov 2005 12:48:09 -0000 1.72 +++ ../../FlightGear/source/src/Input/input.cxx 25 Nov 2005 13:22:07 -0000 @@ -492,8 +492,10 @@ FGInput::_init_joystick () << "\"\nUsing default: \"" << source << '"'); } else { - throw sg_throwable(string("No joystick configuration file with " + static sg_throwable Error( + string("No joystick configuration file with " "<name>default</name> entry found!")); + throw Error; } js_node = js_nodes->getChild("js", i, true); Index: ../../FlightGear/source/src/Main/fg_os_sdl.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Main/fg_os_sdl.cxx,v retrieving revision 1.12 diff -b -u -p -r1.12 fg_os_sdl.cxx --- ../../FlightGear/source/src/Main/fg_os_sdl.cxx 6 Apr 2005 08:46:39 -0000 1.12 +++ ../../FlightGear/source/src/Main/fg_os_sdl.cxx 25 Nov 2005 13:22:09 -0000 @@ -66,12 +66,14 @@ static void initCursors(); void fgOSOpenWindow(int w, int h, int bpp, bool alpha, bool stencil, bool fullscreen) { + static sg_throwable Error; int cbits = (bpp <= 16) ? 5 : 8; int zbits = (bpp <= 16) ? 16 : 24; - if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE) == -1) - throw sg_throwable(string("Failed to initialize SDL: ") - + SDL_GetError()); + if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE) == -1) { + Error.setMessage(string("Failed to initialize SDL: ") + SDL_GetError()); + throw Error; + } atexit(SDL_Quit); SDL_WM_SetCaption("FlightGear", "FlightGear"); @@ -89,9 +91,11 @@ void fgOSOpenWindow(int w, int h, int bp if(fullscreen) { VidMask |= SDL_FULLSCREEN; } - if (SDL_SetVideoMode(w, h, 16, VidMask) == 0) - throw sg_throwable(string("Failed to set SDL video mode: ") - + SDL_GetError()); + if (SDL_SetVideoMode(w, h, 16, VidMask) == 0) { + Error.setMessage( + string("Failed to set SDL video mode: ") + SDL_GetError()); + throw Error; + } // This enables keycode translation (e.g. capital letters when // shift is pressed, as well as i18n input methods). Eventually, @@ -185,6 +189,7 @@ void fgOSExit(int code) void fgOSMainLoop() { + static sg_throwable Error; while(1) { SDL_Event e; int key; @@ -217,8 +222,11 @@ void fgOSMainLoop() break; case SDL_VIDEORESIZE: if (SDL_SetVideoMode(e.resize.w, e.resize.h, 16, VidMask) == 0) - throw sg_throwable(string("Failed to set SDL video mode: ") - + SDL_GetError()); + { + Error.setMessage( + string("Failed to set SDL video mode: ") + SDL_GetError()); + throw Error; + } if (WindowResizeHandler) (*WindowResizeHandler)(e.resize.w, e.resize.h); Index: ../../FlightGear/source/src/Main/options.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Main/options.cxx,v retrieving revision 1.76 diff -b -u -p -r1.76 options.cxx --- ../../FlightGear/source/src/Main/options.cxx 13 Nov 2005 10:20:15 -0000 1.76 +++ ../../FlightGear/source/src/Main/options.cxx 25 Nov 2005 13:22:16 -0000 @@ -1063,7 +1063,7 @@ fgOptConfig( const char *arg ) readProperties(file, globals->get_props()); } catch (const sg_exception &e) { string message = "Error loading config file: "; - message += e.getFormattedMessage(); + message += e.getFormattedMessage() + e.getOrigin(); SG_LOG(SG_INPUT, SG_ALERT, message); exit(2); } Index: ../../FlightGear/source/src/Network/props.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Network/props.cxx,v retrieving revision 1.16 diff -b -u -p -r1.16 props.cxx --- ../../FlightGear/source/src/Network/props.cxx 19 Nov 2004 22:10:43 -0000 1.16 +++ ../../FlightGear/source/src/Network/props.cxx 25 Nov 2005 13:22:16 -0000 @@ -445,7 +445,9 @@ FGProps::FGProps( const vector<string>& } port = atoi( tokens[5].c_str() ); } else { - throw FGProtocolConfigError( "FGProps: incorrect number of configuration arguments" ); + static FGProtocolConfigError + Error( "FGProps: incorrect number of configuration arguments" ); + throw Error; } } Index: ../../FlightGear/source/src/Scenery/FGTileLoader.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Scenery/FGTileLoader.cxx,v retrieving revision 1.13 diff -b -u -p -r1.13 FGTileLoader.cxx --- ../../FlightGear/source/src/Scenery/FGTileLoader.cxx 22 Nov 2005 17:02:31 -0000 1.13 +++ ../../FlightGear/source/src/Scenery/FGTileLoader.cxx 25 Nov 2005 13:22:16 -0000 @@ -94,8 +94,10 @@ FGTileLoader::add( FGTileEntry* tile ) static bool beenhere = false; if (!beenhere) { tile_path = globals->get_fg_scenery(); - if (!tile_path.size()) - throw sg_throwable(string("No valid scenery path defined!")); + if (!tile_path.size()) { + static sg_throwable Error(string("No valid scenery path defined!")); + throw Error; + } beenhere = true; } Index: ../../FlightGear/source/src/Scenery/tilemgr.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Scenery/tilemgr.cxx,v retrieving revision 1.50 diff -b -u -p -r1.50 tilemgr.cxx --- ../../FlightGear/source/src/Scenery/tilemgr.cxx 22 Nov 2005 17:02:31 -0000 1.50 +++ ../../FlightGear/source/src/Scenery/tilemgr.cxx 25 Nov 2005 13:22:17 -0000 @@ -323,8 +323,13 @@ void FGTileMgr::update_queues() SGShadowVolume::occluderTypeTileObject, (ssgBranch *) dm->get_tile()->get_terra_transform()); } - } catch (const sg_exception& exc) { - SG_LOG( SG_ALL, SG_ALERT, exc.getMessage() ); + } catch (const sg_io_exception& exc) { + string m(exc.getMessage()); + m += " "; + m += exc.getLocation().asString(); + SG_LOG( SG_ALL, SG_ALERT, m ); + } catch (const sg_exception& exc) { // XXX may be redundant + SG_LOG( SG_ALL, SG_ALERT, exc.getMessage()); } dm->get_tile()->dec_pending_models(); _______________________________________________ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d