summaryrefslogtreecommitdiff
path: root/Rx/v2/src/rxcpp/rx-composite_exception.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'Rx/v2/src/rxcpp/rx-composite_exception.hpp')
-rw-r--r--Rx/v2/src/rxcpp/rx-composite_exception.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/Rx/v2/src/rxcpp/rx-composite_exception.hpp b/Rx/v2/src/rxcpp/rx-composite_exception.hpp
new file mode 100644
index 0000000..333f291
--- /dev/null
+++ b/Rx/v2/src/rxcpp/rx-composite_exception.hpp
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+#pragma once
+
+#if !defined(RXCPP_SOURCES_RX_COMPOSITE_EXCEPTION_HPP)
+#define RXCPP_SOURCES_RX_COMPOSITE_EXCEPTION_HPP
+
+#include "rx-includes.hpp"
+
+namespace rxcpp {
+
+struct composite_exception : std::exception {
+
+ typedef std::vector<std::exception_ptr> exception_values;
+
+ virtual const char *what() const RXCPP_NOEXCEPT override {
+ return "rxcpp composite exception";
+ }
+
+ virtual bool empty() const {
+ return exceptions.empty();
+ }
+
+ virtual composite_exception add(std::exception_ptr exception_ptr) {
+ exceptions.push_back(exception_ptr);
+ return *this;
+ }
+
+ exception_values exceptions;
+};
+
+}
+
+#endif