aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/exceptions.cpp2
-rw-r--r--src/exceptions.h1
-rw-r--r--src/plugger.h7
3 files changed, 6 insertions, 4 deletions
diff --git a/src/exceptions.cpp b/src/exceptions.cpp
index 9696af8..ce79a5e 100644
--- a/src/exceptions.cpp
+++ b/src/exceptions.cpp
@@ -4,3 +4,5 @@
4subExceptionDef( XmlException ) 4subExceptionDef( XmlException )
5subExceptionDef( FileException ) 5subExceptionDef( FileException )
6subExceptionDef( ConnectionException ) 6subExceptionDef( ConnectionException )
7subExceptionDef( PluginException )
8
diff --git a/src/exceptions.h b/src/exceptions.h
index cf9d47a..0ab2b15 100644
--- a/src/exceptions.h
+++ b/src/exceptions.h
@@ -7,6 +7,7 @@
7subExceptionDecl( XmlException ) 7subExceptionDecl( XmlException )
8subExceptionDecl( FileException ) 8subExceptionDecl( FileException )
9subExceptionDecl( ConnectionException ) 9subExceptionDecl( ConnectionException )
10subExceptionDecl( PluginException )
10 11
11enum eFileException 12enum eFileException
12{ 13{
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 @@
6#include "hashfunctionstring.h" 6#include "hashfunctionstring.h"
7#include "hashfunctionint.h" 7#include "hashfunctionint.h"
8#include "dlfcn.h" 8#include "dlfcn.h"
9#include "exceptions.h"
9 10
10typedef struct PluginInfo 11typedef struct PluginInfo
11{ 12{
@@ -130,14 +131,12 @@ public:
130 pReg->dlHandle = dlopen( sFName, RTLD_NOW ); 131 pReg->dlHandle = dlopen( sFName, RTLD_NOW );
131 if( pReg->dlHandle == NULL ) 132 if( pReg->dlHandle == NULL )
132 { 133 {
133 printf("***ERROR: %s\n\n", dlerror() ); 134 throw PluginException( 1, "Error on %s: %s", sFName, dlerror() );
134 exit( 105 );
135 } 135 }
136 pReg->pInfo = (PluginInfo *)dlsym( pReg->dlHandle, sPluginName ); 136 pReg->pInfo = (PluginInfo *)dlsym( pReg->dlHandle, sPluginName );
137 if( pReg->pInfo == NULL ) 137 if( pReg->pInfo == NULL )
138 { 138 {
139 printf("***ERROR: %s\n\n", dlerror() ); 139 throw PluginException( 2, "Error on %s: %s", sFName, dlerror() );
140 exit( 106 );
141 } 140 }
142 hPlugin.insert( pReg->pInfo->sID, pReg ); 141 hPlugin.insert( pReg->pInfo->sID, pReg );
143 lPlugin.insert( lPlugin.end(), pReg ); 142 lPlugin.insert( lPlugin.end(), pReg );