From 35e0ec0beb169ca7438e8703c6f819e924ae64b5 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Wed, 6 May 2009 16:46:38 +0000 Subject: [PATCH] clearer error message git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1366 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- apps/dsm/DSMChartReader.cpp | 10 ++++++++-- apps/dsm/DSMCoreModule.cpp | 2 -- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/dsm/DSMChartReader.cpp b/apps/dsm/DSMChartReader.cpp index 6af412f4..0f498770 100644 --- a/apps/dsm/DSMChartReader.cpp +++ b/apps/dsm/DSMChartReader.cpp @@ -121,7 +121,11 @@ DSMAction* DSMChartReader::actionFromToken(const string& str) { if (a) return a; } - return core_mod.getAction(str); + DSMAction* a = core_mod.getAction(str); + if (a) return a; + + ERROR("could not find action for '%s' (missing import?)\n", str.c_str()); + return NULL; } DSMCondition* DSMChartReader::conditionFromToken(const string& str, bool invert) { @@ -138,7 +142,9 @@ DSMCondition* DSMChartReader::conditionFromToken(const string& str, bool invert) if (c) c->invert = invert; - return c; + if (c) return c; + ERROR("could not find condition for '%s' (missing import?)\n", str.c_str()); + return NULL; } bool DSMChartReader::importModule(const string& mod_cmd, const string& mod_path) { diff --git a/apps/dsm/DSMCoreModule.cpp b/apps/dsm/DSMCoreModule.cpp index ba43c060..84d1cd64 100644 --- a/apps/dsm/DSMCoreModule.cpp +++ b/apps/dsm/DSMCoreModule.cpp @@ -93,7 +93,6 @@ DSMAction* DSMCoreModule::getAction(const string& from_str) { DEF_CMD("B2B.terminateOtherLeg", SCB2BTerminateOtherLegAction); DEF_CMD("B2B.sendReinvite", SCB2BReinviteAction); - ERROR("could not find action named '%s'\n", cmd.c_str()); return NULL; } @@ -143,7 +142,6 @@ DSMCondition* DSMCoreModule::getCondition(const string& from_str) { if (cmd == "B2B.otherBye") return new TestDSMCondition(params, DSMCondition::B2BOtherBye); - ERROR("could not find condition for '%s'\n", cmd.c_str()); return NULL; }