zmqpp 4.1.2
C++ bindings for 0mq (libzmq)
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#include "compatibility.hpp"
26
27namespace zmqpp
28{
29
42class ZMQPP_EXPORT exception : public std::runtime_error
43{
44public:
50 exception(std::string const& message)
51 : std::runtime_error(message)
52 { }
53};
54
61{
62public:
63 invalid_instance(std::string const& message)
65 { }
66};
67
72 {
73 public:
74
76 exception("Actor Initialization Exception")
77 {
78 }
79
80 };
81
87 {
88 public:
89 z85_exception(const std::string &msg):
90 exception(msg)
91 {
92 }
93 };
94
103{
104public:
109 : exception(zmq_strerror(zmq_errno()))
110 , _error(zmq_errno())
111 { }
112
117 int zmq_error() const { return _error; }
118
119private:
121};
122
123}
124
125#endif /* ZMQPP_EXCEPTION_HPP_ */
Represents a failed zmqpp::actor initialization.
Definition: exception.hpp:72
actor_initialization_exception()
Definition: exception.hpp:75
Represents the base zmqpp exception.
Definition: exception.hpp:43
exception(std::string const &message)
Standard exception constructor.
Definition: exception.hpp:50
Represents an attempt to use an invalid object.
Definition: exception.hpp:61
invalid_instance(std::string const &message)
Definition: exception.hpp:63
a zmq message with optional multipart support
Definition: message.hpp:44
Thrown when an error occurs while encoding or decoding to/from z85.
Definition: exception.hpp:87
z85_exception(const std::string &msg)
Definition: exception.hpp:89
Represents internal zmq errors.
Definition: exception.hpp:103
int zmq_error() const
Retrieve the zmq error number associated with this exception.
Definition: exception.hpp:117
int _error
Definition: exception.hpp:120
zmq_internal_exception()
Uses the zmq functions to pull out error messages and numbers.
Definition: exception.hpp:108
#define ZMQPP_EXPORT
Definition: compatibility.hpp:39
STL namespace.
C++ wrapper around zmq.
Definition: actor.cpp:30