diff --git a/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientBidiReactorBase.h b/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientBidiReactorBase.h --- a/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientBidiReactorBase.h +++ b/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientBidiReactorBase.h @@ -35,10 +35,15 @@ template void ClientBidiReactorBase::nextWrite() { this->request = Request(); - std::unique_ptr status = - this->prepareRequest(this->request, this->response); - if (status != nullptr) { - this->terminate(*status); + try { + std::unique_ptr status = + this->prepareRequest(this->request, this->response); + if (status != nullptr) { + this->terminate(*status); + return; + } + } catch (std::runtime_error &e) { + this->terminate(grpc::Status(grpc::StatusCode::INTERNAL, e.what())); return; } this->StartWrite(&this->request); diff --git a/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientReadReactorBase.h b/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientReadReactorBase.h --- a/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientReadReactorBase.h +++ b/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientReadReactorBase.h @@ -59,10 +59,14 @@ this->terminate(grpc::Status::OK); return; } - std::unique_ptr status = this->readResponse(this->response); - if (status != nullptr) { - this->terminate(*status); - return; + try { + std::unique_ptr status = this->readResponse(this->response); + if (status != nullptr) { + this->terminate(*status); + return; + } + } catch (std::runtime_error &e) { + this->terminate(grpc::Status(grpc::StatusCode::INTERNAL, e.what())); } this->StartRead(&this->response); } diff --git a/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientWriteReactorBase.h b/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientWriteReactorBase.h --- a/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientWriteReactorBase.h +++ b/services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientWriteReactorBase.h @@ -29,10 +29,14 @@ template void ClientWriteReactorBase::nextWrite() { this->request = Request(); - std::unique_ptr status = this->prepareRequest(this->request); - if (status != nullptr) { - this->terminate(*status); - return; + try { + std::unique_ptr status = this->prepareRequest(this->request); + if (status != nullptr) { + this->terminate(*status); + return; + } + } catch (std::runtime_error &e) { + this->terminate(grpc::Status(grpc::StatusCode::INTERNAL, e.what())); } this->StartWrite(&this->request); if (!this->initialized) {