summaryrefslogtreecommitdiff
path: root/Rx/v2/src/rxcpp/rx-composite_exception.hpp
blob: cddd03ed13849873de83b0cb3fca04d108b7cfe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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<rxu::error_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(rxu::error_ptr exception_ptr) {
        exceptions.push_back(exception_ptr);
        return *this;
    }

    exception_values exceptions;
};

}

#endif