BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
MultiException.h
1 #pragma once
2 
3 #include <vector>
4 
5 #include <Poco/Exception.h>
6 
7 namespace BeeeOn {
8 
17 class MultiException : public Poco::Exception {
18 public:
20 
25  MultiException(const std::string &msg);
26 
31  MultiException(const std::vector<Poco::Exception> &e);
32 
34  ~MultiException();
35 
36  MultiException &operator = (const MultiException &e);
37  const char *name() const noexcept override;
38  Poco::Exception *clone() const override;
39  void rethrow() const override;
40 
48  void caught(const Poco::Exception &e);
49  std::vector<Poco::Exception *>::const_iterator begin() const;
50  std::vector<Poco::Exception *>::const_iterator end() const;
51 
56  bool empty() const;
57 
61  size_t count() const;
62 
63 protected:
64  void add(const Poco::Exception &e);
65  void clear();
66 
67 private:
68  std::vector<Poco::Exception *> m_exceptions;
69 };
70 
71 }
bool empty() const
Definition: MultiException.cpp:43
void caught(const Poco::Exception &e)
Add a caught exception for later processing. It also constructs the message to contain a limited numb...
Definition: MultiException.cpp:92
MultiException is used to collect multiple exceptions thrown during some processing we do not want to...
Definition: MultiException.h:17
size_t count() const
Definition: MultiException.cpp:48