]> git.mxchange.org Git - flightgear.git/commitdiff
Vassilii Khachaturov:
authorehofman <ehofman>
Sun, 11 Dec 2005 13:37:06 +0000 (13:37 +0000)
committerehofman <ehofman>
Sun, 11 Dec 2005 13:37:06 +0000 (13:37 +0000)
* in some cases more specific sg exception types were used in place
  of the more generic one, e.g., sg_io_exception instead of sg_exception
  when the context of the error was an IO error
* in some cases, the error message was made more specific
* minor style fix for exception rethrowing --- using throw; whenever
  a re-throw is made; sometimes optimizing away the exception symbol name
  in the catch handler at all
* more specific catch handlers added in some places -- e.g.,
  an sg_io_exception caught ahead of sg_exception

src/ATC/AIMgr.cxx
src/Main/options.cxx
src/Scenery/tilemgr.cxx

index 2af6a0daf77fbf810c61ee9580dc43e26806d885..3c36cde91721b5996538cda2f8858e6be783599a 100644 (file)
@@ -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 0b0c8acf22145633e6c175262e604bf1027b1f39..8fe9ab211215db38667a76ade5d781b1a3662c03 100644 (file)
@@ -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 353be612d132d43f5bba91ed3f27df334b386015..ddfeb906a5b7bd1c68a78ebdce527cfa8bf0e3a2 100644 (file)
@@ -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();