1 | // Copyright (c) Facebook, Inc. and its affiliates. |
---|---|
2 | // All rights reserved. |
3 | // |
4 | // This source code is licensed under the BSD-style license found in the |
5 | // LICENSE file in the root directory of this source tree. |
6 | |
7 | #pragma once |
8 | |
9 | #include <stdexcept> |
10 | |
11 | #include <c10/macros/Macros.h> |
12 | |
13 | namespace c10d { |
14 | |
15 | class TORCH_API C10dError : public std::runtime_error { |
16 | public: |
17 | using std::runtime_error::runtime_error; |
18 | |
19 | C10dError(const C10dError&) = default; |
20 | |
21 | C10dError& operator=(const C10dError&) = default; |
22 | |
23 | C10dError(C10dError&&) = default; |
24 | |
25 | C10dError& operator=(C10dError&&) = default; |
26 | |
27 | ~C10dError() override; |
28 | }; |
29 | |
30 | class TORCH_API TimeoutError : public C10dError { |
31 | public: |
32 | using C10dError::C10dError; |
33 | |
34 | TimeoutError(const TimeoutError&) = default; |
35 | |
36 | TimeoutError& operator=(const TimeoutError&) = default; |
37 | |
38 | TimeoutError(TimeoutError&&) = default; |
39 | |
40 | TimeoutError& operator=(TimeoutError&&) = default; |
41 | |
42 | ~TimeoutError() override; |
43 | }; |
44 | |
45 | } // namespace c10d |
46 |