#ifndef ZMQ_BZOOK_EXCEPTION_H
#define ZMQ_BZOOK_EXCEPTION_H

#include "bibun_util/exception.h"

namespace bzook
{

class Exception : public bibunu::Exception
{
public:
   Exception();
   Exception(std::string context);

   Exception(const Exception&) = default;
   // Move is equivalent to a copy in this case, because an Exception is simple ints and pointers.
   Exception(Exception&&) = default;

   virtual const char *what() const noexcept;

   int errorNumber() const;

   virtual ~Exception();
private:
   int _errno;
   const char *_zmq_message;
};

class ZmqTermination : public bzook::Exception
{
public:
   ZmqTermination();

   ZmqTermination(const ZmqTermination&) = default;
   ZmqTermination(ZmqTermination&&) = default;

   virtual ~ZmqTermination();
};

class ZmqError : public bzook::Exception
{
public:
   ZmqError();
   ZmqError(std::string context);

   ZmqError(const ZmqError&) = default;
   ZmqError(ZmqError&&) = default;

   virtual ~ZmqError();
};

}

#endif // ZMQ_BZOOK_EXCEPTION_H
