1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/PluginScriptException.h
12 #ifndef ZYPP_PLUGINSCRIPTEXCEPTION_H
13 #define ZYPP_PLUGINSCRIPTEXCEPTION_H
17 #include "zypp/base/Exception.h"
18 #include "zypp/Pathname.h"
20 ///////////////////////////////////////////////////////////////////
22 { /////////////////////////////////////////////////////////////////
24 /** Base class for \ref PluginScript \ref Exception. */
25 class PluginScriptException : public Exception
28 PluginScriptException();
29 PluginScriptException( const std::string & msg_r );
30 PluginScriptException( const std::string & msg_r, const std::string & hist_r );
31 virtual ~PluginScriptException() throw();
34 /** Convenience macro to declare more specific PluginScriptExceptions. */
35 #define declException( EXCP, BASE ) \
36 class EXCP : public BASE { \
38 EXCP() : BASE( #EXCP ) {} \
39 EXCP( const std::string & msg_r ) : BASE( msg_r ) {} \
40 EXCP( const std::string & msg_r, const std::string & hist_r ) : BASE( msg_r, hist_r ) {} \
41 virtual ~EXCP() throw() {} \
44 /** Script connection not open. */
45 declException( PluginScriptNotConnected, PluginScriptException );
47 /** Script died unexpectedly. */
48 declException( PluginScriptDiedUnexpectedly, PluginScriptException );
51 /** Communication timeout. */
52 declException( PluginScriptTimeout, PluginScriptException );
54 /** Timeout while sending data. */
55 declException( PluginScriptSendTimeout, PluginScriptTimeout );
57 /** Timeout while receiving data. */
58 declException( PluginScriptReceiveTimeout, PluginScriptTimeout );
62 /////////////////////////////////////////////////////////////////
64 ///////////////////////////////////////////////////////////////////
65 #endif // ZYPP_PLUGINSCRIPTEXCEPTION_H