From 7a081ca8b5d58cbe88e06ee50c47b973d571172b Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 3 Jun 2011 10:42:40 +0200 Subject: [PATCH] Changed: Exceptions catched by reference --- code/ryzom/client/src/net_manager.cpp | 14 +++++++------- .../server/src/ai_service/ai_script_comp.cpp | 16 ++++++++-------- code/ryzom/server/src/ai_service/commands.cpp | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index a450424fb..94086adb9 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -168,7 +168,7 @@ void impulseDatabaseInitPlayer(NLMISC::CBitMemStream &impulse) IngameDbMngr.setInitPacketReceived(); nlinfo( "DB_INIT:PLR done (%u bytes)", impulse.getPos()-p ); } - catch (Exception &e) + catch (const Exception &e) { BOMB( NLMISC::toString( "Problem while decoding a DB_INIT:PLR msg, skipped: %s", e.what() ), return ); } @@ -185,7 +185,7 @@ void impulseDatabaseUpdatePlayer(NLMISC::CBitMemStream &impulse) // read delta IngameDbMngr.readDelta( serverTick, impulse, CDBPlayer ); // unlike on the server, here there is only one unified CCDBSynchronized object } - catch (Exception &e) + catch (const Exception &e) { BOMB( NLMISC::toString( "Problem while decoding a DB_UPDATE_PLR msg, skipped: %s", e.what() ), return ); @@ -218,7 +218,7 @@ void impulseDatabaseUpdateBank(NLMISC::CBitMemStream &impulse) updateInventoryFromStream( impulse, (INVENTORIES::CInventoryCategoryForGuild*)NULL, false ); } } - catch (Exception &e) + catch (const Exception &e) { BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:UPDATE_BANK %s msg, skipped: %s", CDBBankNames[bank], e.what() ), return ); } @@ -248,7 +248,7 @@ void impulseDatabaseInitBank(NLMISC::CBitMemStream &impulse) updateInventoryFromStream( impulse, (INVENTORIES::CInventoryCategoryForGuild*)NULL, false ); } } - catch (Exception &e) + catch (const Exception &e) { BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:INIT_BANK %s msg, skipped: %s", CDBBankNames[bank], e.what() ), return ); } @@ -272,7 +272,7 @@ void impulseDatabaseResetBank(NLMISC::CBitMemStream &impulse) IngameDbMngr.getNodePtr()->resetBank( serverTick, (TCDBBank)bank ); nldebug( "CDB: DB_GROUP:RESET_BANK %s", CDBBankNames[bank] ); } - catch (Exception &e) + catch (const Exception &e) { BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:RESET_BANK %s msg, skipped: %s", CDBBankNames[bank], e.what() ), return ); } @@ -1568,7 +1568,7 @@ void impulseTPCommon2(NLMISC::CBitMemStream &impulse, bool hasSeason) } } - catch (EStream &) + catch (const EStream &) { tpReason = ucstring("TP Reason"); tpCancelText = ucstring("Cancel TP"); // for test @@ -2236,7 +2236,7 @@ void impulseCounter(NLMISC::CBitMemStream &impulse) } } } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("Problem while decoding a COUTNER msg, skipped: %s", e.what()); } diff --git a/code/ryzom/server/src/ai_service/ai_script_comp.cpp b/code/ryzom/server/src/ai_service/ai_script_comp.cpp index fbb33722c..0209eeec0 100644 --- a/code/ryzom/server/src/ai_service/ai_script_comp.cpp +++ b/code/ryzom/server/src/ai_service/ai_script_comp.cpp @@ -96,7 +96,7 @@ CFightScriptComp *CFightSelectFilterReader::create (const std::string &inStr) th { scriptComp=createScriptComp(params[1]); } - catch (ReadFightActionException &ex) + catch (const ReadFightActionException &ex) { throw ReadFightActionException("cannot create sub ScriptComp : "+std::string(ex.what())); } @@ -164,7 +164,7 @@ public: { scriptComp=createScriptComp(params[0]); } - catch (ReadFightActionException &ex) + catch (const ReadFightActionException &ex) { throw ReadFightActionException("cannot create sub ScriptComp : "+string(ex.what())); } @@ -244,7 +244,7 @@ public: { scriptComp=createScriptComp(params[1]); } - catch (ReadFightActionException &ex) + catch (const ReadFightActionException &ex) { throw ReadFightActionException("cannot create sub ScriptComp : "+string(ex.what())); } @@ -315,7 +315,7 @@ public: { scriptComp=createScriptComp(params[1]); } - catch (ReadFightActionException &ex) + catch (const ReadFightActionException &ex) { throw ReadFightActionException("cannot create sub ScriptComp : "+string(ex.what())); } @@ -385,7 +385,7 @@ public: { scriptComp=createScriptComp(params[1]); } - catch (ReadFightActionException &ex) + catch (const ReadFightActionException &ex) { throw ReadFightActionException("cannot create sub ScriptComp : "+string(ex.what())); } @@ -456,7 +456,7 @@ public: { scriptComp=createScriptComp(params[1]); } - catch (ReadFightActionException &ex) + catch (const ReadFightActionException &ex) { throw ReadFightActionException("cannot create sub ScriptComp : "+string(ex.what())); } @@ -1012,7 +1012,7 @@ public: for (uint32 i=0;icreate(str); } - catch (ReadFightActionException &e) + catch (const ReadFightActionException &e) { throw ReadFightActionException(string("ScriptComp creation failed : ")+string(e.what())); } diff --git a/code/ryzom/server/src/ai_service/commands.cpp b/code/ryzom/server/src/ai_service/commands.cpp index 851de164f..2cc465990 100644 --- a/code/ryzom/server/src/ai_service/commands.cpp +++ b/code/ryzom/server/src/ai_service/commands.cpp @@ -1825,7 +1825,7 @@ bool execLoadScript(CStringWriter& stringWriter, vector const& args) FOREACHC(itGrp, vector, grps) (*itGrp)->getPersistentStateInstance()->interpretCode(NULL, codePtr); } - catch (const EPathNotFound &e) + catch (const EPathNotFound &) { nlwarning("Path not found while loading AIS script %s", args[2].c_str()); return false;