Skip to content

Commit 2a85c24

Browse files
committed
New oatpp Async error handling.
1 parent 724a1b0 commit 2a85c24

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/oatpp-mbedtls/FullAsyncClientTest.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ class ClientCoroutine_getRootAsync : public oatpp::async::Coroutine<ClientCorout
155155
return finish();
156156
}
157157

158-
Action handleError(const std::shared_ptr<const Error>& error) override {
158+
Action handleError(Error* error) override {
159159
if(error->is<oatpp::data::AsyncIOError>()) {
160-
auto e = static_cast<const oatpp::data::AsyncIOError*>(error.get());
160+
auto e = static_cast<oatpp::data::AsyncIOError*>(error);
161161
OATPP_LOGD("[FullAsyncClientTest::ClientCoroutine_echoBodyAsync::handleError()]", "AsyncIOError. %s, %d", e->what(), e->getCode());
162162
} else {
163163
OATPP_LOGD("[FullAsyncClientTest::ClientCoroutine_echoBodyAsync::handleError()]", "Error. %s", error->what());
164164
}
165-
return propagateError();
165+
return error;
166166
}
167167

168168
};
@@ -200,16 +200,16 @@ class ClientCoroutine_echoBodyAsync : public oatpp::async::Coroutine<ClientCorou
200200
return finish();
201201
}
202202

203-
Action handleError(const std::shared_ptr<const Error>& error) override {
203+
Action handleError(Error* error) override {
204204
if(error) {
205205
if(error->is<oatpp::data::AsyncIOError>()) {
206-
auto e = static_cast<const oatpp::data::AsyncIOError*>(error.get());
206+
auto e = static_cast<oatpp::data::AsyncIOError*>(error);
207207
OATPP_LOGD("[FullAsyncClientTest::ClientCoroutine_echoBodyAsync::handleError()]", "AsyncIOError. %s, %d", e->what(), e->getCode());
208208
} else {
209209
OATPP_LOGD("[FullAsyncClientTest::ClientCoroutine_echoBodyAsync::handleError()]", "Error. %s", error->what());
210210
}
211211
}
212-
return propagateError();
212+
return error;
213213
}
214214

215215
};

test/oatpp-mbedtls/FullAsyncTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,15 @@ void FullAsyncTest::onRun() {
156156
auto value = response->readBodyToString();
157157
OATPP_ASSERT(value == "Hello World Async!!!");
158158
}
159-
159+
160160
{ // test GET with path parameter
161161
auto response = client->getWithParams("my_test_param-Async", connection);
162162
OATPP_ASSERT(response->getStatusCode() == 200);
163163
auto dto = response->readBodyToDto<app::TestDto>(objectMapper.get());
164164
OATPP_ASSERT(dto);
165165
OATPP_ASSERT(dto->testValue == "my_test_param-Async");
166166
}
167-
167+
168168
{ // test GET with header parameter
169169
auto response = client->getWithHeaders("my_test_header-Async", connection);
170170
OATPP_ASSERT(response->getStatusCode() == 200);

0 commit comments

Comments
 (0)