AgentXcpp  Revision:0.1
Internals Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
/home/tanjeff/projekte/agentxcpp/src/exceptions.hpp
Go to the documentation of this file.
00001 /*
00002  * Copyright 2011-2012 Tanjeff-Nicolai Moos <tanjeff@cccmz.de>
00003  *
00004  * This file is part of the agentXcpp library.
00005  *
00006  * AgentXcpp is free software: you can redistribute it and/or modify
00007  * it under the terms of the AgentXcpp library license, version 1, which 
00008  * consists of the GNU General Public License and some additional 
00009  * permissions.
00010  *
00011  * AgentXcpp is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * See the AgentXcpp library license in the LICENSE file of this package 
00017  * for more details.
00018  */
00019 
00020 #ifndef _EXCEPTIONS_H_
00021 #define _EXCEPTIONS_H_
00022 
00023 #include <exception>
00024 
00025 namespace agentxcpp
00026 {
00027 
00028     /**
00029      * \brief Exception for parse errors
00030      */
00031     class parse_error : public std::exception { };
00032 
00033     /**
00034      * \brief Exception for invalid parameter.
00035      */
00036     class inval_param : public std::exception { };
00037 
00038     /**
00039      * \brief Exception for reception of %PDU with invalid version number.
00040      */
00041     class version_error : public std::exception { };
00042 
00043     /**
00044      * \brief Exception to indicate a disconnected state
00045      */
00046     class disconnected : public std::exception { };
00047 
00048     /**
00049      * \brief Exception to indicate a timeout
00050      */
00051     class timeout_error : public std::exception { };
00052 
00053     /**
00054      * \brief Exception to indicate a network error
00055      */
00056     class network_error : public std::exception { };
00057 
00058     /**
00059      * \brief Exception to indicate an internal error.
00060      *
00061      * This is probably a programming error in the AgentXcpp library.
00062      */
00063     class internal_error : public std::exception { };
00064 
00065     /**
00066      * \brief Exception to indicate that the master agent was unable to process a 
00067      *        request.
00068      */
00069     class master_is_unable : public std::exception { };
00070 
00071     /**
00072      * \brief Exception to indicate that the master agent was not willing to 
00073      *        process a request.
00074      *
00075      * This could for example happen if the the master agent does not wish to 
00076      * permit a registration for implementation-specific reasons.
00077      */
00078     class master_is_unwilling : public std::exception { };
00079 
00080     /**
00081      * \brief Exception to indicate that a MIB region was registered twice with 
00082      *        the same priority.
00083      *
00084      * This error can occur if two distinct subagents register the same subtree 
00085      * with the same priority. It can of course also occur if a single subagent 
00086      * does a double-registration.
00087      */
00088     class duplicate_registration : public std::exception { };
00089 
00090     /**
00091      * \brief Exception to indicate that a MIB region registration was not
00092      *        found.
00093      *
00094      * This error can occur when unregistering a MIB region which was not 
00095      * previously registered. It also occurs when adding an SNMP variable with 
00096      * an OID which does not reside within a registered MIB region.
00097      */
00098     class unknown_registration : public std::exception { };
00099 
00100     /**
00101      * \brief Exception to indicate that obtaining the value of an SNMP
00102      *        variable failed.
00103      */
00104     class generic_error : public std::exception { };
00105 
00106 } // namespace agentxcpp
00107 
00108 #endif