Make SemiFuture::via throw on nullptr executor.
[folly.git] / folly / futures / FutureException.cpp
1 /*
2  * Copyright 2017 Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <folly/futures/FutureException.h>
18
19 namespace folly {
20
21 [[noreturn]] void throwNoState() {
22   throw NoState();
23 }
24
25 [[noreturn]] void throwPromiseAlreadySatisfied() {
26   throw PromiseAlreadySatisfied();
27 }
28
29 [[noreturn]] void throwFutureNotReady() {
30   throw FutureNotReady();
31 }
32
33 [[noreturn]] void throwFutureAlreadyRetrieved() {
34   throw FutureAlreadyRetrieved();
35 }
36
37 [[noreturn]] void throwTimedOut() {
38   throw TimedOut();
39 }
40
41 [[noreturn]] void throwPredicateDoesNotObtain() {
42   throw PredicateDoesNotObtain();
43 }
44
45 [[noreturn]] void throwNoFutureInSplitter() { throw NoFutureInSplitter(); }
46
47     [[noreturn]] void throwNoExecutor() {
48   throw NoExecutor();
49 }
50 } // namespace folly