From e82431fb4f5155220c8c0d3f7d11c6d60ab475a4 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 30 Jan 2007 22:40:07 +0000 Subject: Hey, Plugger doesn't kill your program with exit, it just throws an exception. --- src/plugger.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/plugger.h') diff --git a/src/plugger.h b/src/plugger.h index b531fae..ee7594a 100644 --- a/src/plugger.h +++ b/src/plugger.h @@ -6,6 +6,7 @@ #include "hashfunctionstring.h" #include "hashfunctionint.h" #include "dlfcn.h" +#include "exceptions.h" typedef struct PluginInfo { @@ -130,14 +131,12 @@ public: pReg->dlHandle = dlopen( sFName, RTLD_NOW ); if( pReg->dlHandle == NULL ) { - printf("***ERROR: %s\n\n", dlerror() ); - exit( 105 ); + throw PluginException( 1, "Error on %s: %s", sFName, dlerror() ); } pReg->pInfo = (PluginInfo *)dlsym( pReg->dlHandle, sPluginName ); if( pReg->pInfo == NULL ) { - printf("***ERROR: %s\n\n", dlerror() ); - exit( 106 ); + throw PluginException( 2, "Error on %s: %s", sFName, dlerror() ); } hPlugin.insert( pReg->pInfo->sID, pReg ); lPlugin.insert( lPlugin.end(), pReg ); -- cgit v1.2.3