We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent caddc57 commit 72c2f86Copy full SHA for 72c2f86
src/viam/sdk/rpc/dial.cpp
@@ -123,19 +123,18 @@ std::shared_ptr<ViamChannel> ViamChannel::dial_initial(
123
}
124
opts.set_timeout(opts.initial_connection_attempt_timeout());
125
126
- std::exception exception;
127
- while (attempts_remaining > 0) {
+ while (attempts_remaining != 0) {
128
try {
129
auto connection = dial(uri, opts);
130
opts.set_timeout(timeout);
131
return connection;
132
} catch (const std::exception& e) {
133
attempts_remaining -= 1;
134
- exception = e;
+ if (attempts_remaining == 0) {
+ throw e;
135
+ }
136
137
-
138
- throw Exception(ErrorCondition::k_connection, exception.what());
139
140
141
std::shared_ptr<ViamChannel> ViamChannel::dial(const char* uri,
0 commit comments