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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
diff --git a/rsocket/RSocketServer.cpp b/rsocket/RSocketServer.cpp
index 1e20281..3a9f6b2 100644
--- a/rsocket/RSocketServer.cpp
+++ b/rsocket/RSocketServer.cpp
@@ -125,7 +125,7 @@ void RSocketServer::acceptConnection(
weakConSet = std::weak_ptr<ConnectionSet>(connectionSet_),
scheduledResponder = useScheduledResponder_](
std::unique_ptr<DuplexConnection> conn,
- SetupParameters params) mutable {
+ SetupParameters params) mutable noexcept{
if (auto connectionSet = weakConSet.lock()) {
RSocketServer::onRSocketSetup(
serviceHandler,
@@ -135,12 +135,15 @@ void RSocketServer::acceptConnection(
std::move(params));
}
},
- std::bind(
- &RSocketServer::onRSocketResume,
- this,
- serviceHandler,
- std::placeholders::_1,
- std::placeholders::_2));
+ [this, serviceHandler=serviceHandler](
+ std::unique_ptr<DuplexConnection> connection,
+ ResumeParameters resumeParameters) mutable noexcept{
+ this->onRSocketResume(
+ serviceHandler,
+ std::move(connection),
+ resumeParameters
+ );
+ });
}
void RSocketServer::onRSocketSetup(
@@ -206,7 +209,7 @@ void RSocketServer::onRSocketSetup(
void RSocketServer::onRSocketResume(
std::shared_ptr<RSocketServiceHandler> serviceHandler,
std::unique_ptr<DuplexConnection> connection,
- ResumeParameters resumeParams) {
+ ResumeParameters resumeParams) noexcept{
auto result = serviceHandler->onResume(resumeParams.token);
if (result.hasError()) {
stats_->resumeFailedNoState();
diff --git a/rsocket/RSocketServer.h b/rsocket/RSocketServer.h
index 39dae66..e2346ef 100644
--- a/rsocket/RSocketServer.h
+++ b/rsocket/RSocketServer.h
@@ -118,7 +118,7 @@ class RSocketServer {
void onRSocketResume(
std::shared_ptr<RSocketServiceHandler> serviceHandler,
std::unique_ptr<DuplexConnection> connection,
- rsocket::ResumeParameters setupPayload);
+ rsocket::ResumeParameters setupPayload)noexcept;
const std::unique_ptr<ConnectionAcceptor> duplexConnectionAcceptor_;
bool started{false};
diff --git a/yarpl/flowable/AsyncGeneratorShim.h b/yarpl/flowable/AsyncGeneratorShim.h
index 72d212c..79a09f1 100644
--- a/yarpl/flowable/AsyncGeneratorShim.h
+++ b/yarpl/flowable/AsyncGeneratorShim.h
@@ -96,7 +96,7 @@ class AsyncGeneratorShim {
value.emplace(std::move(*item));
}
} catch (const std::exception& ex) {
- value.emplaceException(std::current_exception(), ex);
+ value.emplaceException(std::current_exception());
} catch (...) {
value.emplaceException(std::current_exception());
}
diff --git a/yarpl/flowable/Flowable.h b/yarpl/flowable/Flowable.h
index 9dff78b..bccd70d 100644
--- a/yarpl/flowable/Flowable.h
+++ b/yarpl/flowable/Flowable.h
@@ -494,7 +494,7 @@ std::shared_ptr<Flowable<T>> Flowable<T>::fromGenerator(
}
} catch (const std::exception& ex) {
subscriber.onError(
- folly::exception_wrapper(std::current_exception(), ex));
+ folly::exception_wrapper(std::current_exception()));
} catch (...) {
subscriber.onError(std::runtime_error(
"Flowable::fromGenerator() threw from Subscriber:onNext()"));
diff --git a/yarpl/flowable/FlowableOperator.h b/yarpl/flowable/FlowableOperator.h
index 314ba7f..fe63504 100644
--- a/yarpl/flowable/FlowableOperator.h
+++ b/yarpl/flowable/FlowableOperator.h
@@ -178,7 +178,7 @@ class MapOperator : public FlowableOperator<U, D> {
this->subscriberOnNext(flowable->function_(std::move(value)));
}
} catch (const std::exception& exn) {
- folly::exception_wrapper ew{std::current_exception(), exn};
+ folly::exception_wrapper ew{std::current_exception()};
this->terminateErr(std::move(ew));
}
}
@@ -190,7 +190,7 @@ class MapOperator : public FlowableOperator<U, D> {
}
} catch (const std::exception& exn) {
this->terminateErr(
- folly::exception_wrapper{std::current_exception(), exn});
+ folly::exception_wrapper{std::current_exception()});
}
}
@@ -570,7 +570,7 @@ class FlatMapOperator : public FlowableOperator<T, R> {
try {
mappedStream = flowable_->function_(std::move(value));
} catch (const std::exception& exn) {
- folly::exception_wrapper ew{std::current_exception(), exn};
+ folly::exception_wrapper ew{std::current_exception()};
{
std::lock_guard<std::mutex> g(onErrorExGuard_);
onErrorEx_ = ew;
diff --git a/yarpl/flowable/Subscriber.h b/yarpl/flowable/Subscriber.h
index d1dc3b5..582f9c4 100644
--- a/yarpl/flowable/Subscriber.h
+++ b/yarpl/flowable/Subscriber.h
@@ -301,7 +301,7 @@ class Base : public LambdaSubscriber<T> {
next_(std::move(value));
} catch (const std::exception& exn) {
this->cancel();
- auto ew = folly::exception_wrapper{std::current_exception(), exn};
+ auto ew = folly::exception_wrapper{std::current_exception()};
LOG(ERROR) << "'next' method should not throw: " << ew.what();
onErrorImpl(ew);
return;
diff --git a/yarpl/observable/ObservableOperator.h b/yarpl/observable/ObservableOperator.h
index 451c6bd..0e60b48 100644
--- a/yarpl/observable/ObservableOperator.h
+++ b/yarpl/observable/ObservableOperator.h
@@ -196,7 +196,7 @@ class MapOperator : public ObservableOperator<U, D> {
try {
this->observerOnNext(observable_->function_(std::move(value)));
} catch (const std::exception& exn) {
- folly::exception_wrapper ew{std::current_exception(), exn};
+ folly::exception_wrapper ew{std::current_exception()};
this->terminateErr(std::move(ew));
}
}
diff --git a/yarpl/single/SingleOperator.h b/yarpl/single/SingleOperator.h
index 0b3e739..4defd64 100644
--- a/yarpl/single/SingleOperator.h
+++ b/yarpl/single/SingleOperator.h
@@ -197,7 +197,7 @@ class MapOperator : public SingleOperator<U, D> {
auto map_operator = this->getOperator();
this->observerOnSuccess(map_operator->function_(std::move(value)));
} catch (const std::exception& exn) {
- folly::exception_wrapper ew{std::current_exception(), exn};
+ folly::exception_wrapper ew{std::current_exception()};
this->observerOnError(std::move(ew));
}
}
|