zmqpp  4.1.2
C++ bindings for 0mq (libzmq)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
exception.hpp
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * This file is part of zmqpp.
7  * Copyright (c) 2011-2015 Contributors as noted in the AUTHORS file.
8  */
9 
17 #ifndef ZMQPP_EXCEPTION_HPP_
18 #define ZMQPP_EXCEPTION_HPP_
19 
20 #include <stdexcept>
21 #include <string>
22 
23 #include <zmq.h>
24 
25 namespace zmqpp
26 {
27 
40 class exception : public std::runtime_error
41 {
42 public:
48  exception(std::string const& message)
49  : std::runtime_error(message)
50  { }
51 };
52 
59 {
60 public:
61  invalid_instance(std::string const& message)
62  : exception(message)
63  { }
64 };
65 
70  {
71  public:
72 
74  exception("Actor Initialization Exception")
75  {
76  }
77 
78  };
79 
84  class z85_exception : public exception
85  {
86  public:
87  z85_exception(const std::string &msg):
88  exception(msg)
89  {
90  }
91  };
92 
101 {
102 public:
107  : exception(zmq_strerror(zmq_errno()))
108  , _error(zmq_errno())
109  { }
110 
115  int zmq_error() const { return _error; }
116 
117 private:
118  int _error;
119 };
120 
121 }
122 
123 #endif /* ZMQPP_EXCEPTION_HPP_ */
exception(std::string const &message)
Standard exception constructor.
Definition: exception.hpp:48
C++ wrapper around zmq.
Definition: actor.cpp:29
actor_initialization_exception()
Definition: exception.hpp:73
STL namespace.
zmq_internal_exception()
Uses the zmq functions to pull out error messages and numbers.
Definition: exception.hpp:106
Represents internal zmq errors.
Definition: exception.hpp:100
Represents a failed zmqpp::actor initialization.
Definition: exception.hpp:69
z85_exception(const std::string &msg)
Definition: exception.hpp:87
int zmq_error() const
Retrieve the zmq error number associated with this exception.
Definition: exception.hpp:115
Represents the base zmqpp exception.
Definition: exception.hpp:40
a zmq message with optional multipart support
Definition: message.hpp:43
Represents an attempt to use an invalid object.
Definition: exception.hpp:58
int _error
Definition: exception.hpp:118
invalid_instance(std::string const &message)
Definition: exception.hpp:61
Thrown when an error occurs while encoding or decoding to/from z85.
Definition: exception.hpp:84