diff --git a/ydb/core/tx/schemeshard/schemeshard_export_scheme_uploader.cpp b/ydb/core/tx/schemeshard/schemeshard_export_scheme_uploader.cpp index e3900d35a858..851e6e9c8f04 100644 --- a/ydb/core/tx/schemeshard/schemeshard_export_scheme_uploader.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_export_scheme_uploader.cpp @@ -55,28 +55,19 @@ class TSchemeUploader: public TActorBootstrapped { << ", status: " << describeResult.GetStatus() ); - auto reportError = [&](const TString& error) { - Send(SchemeShard, new TEvPrivate::TEvExportSchemeUploadResult( - ExportId, ItemIdx, false, error - )); - }; - if (describeResult.GetStatus() != TEvSchemeShard::EStatus::StatusSuccess) { - reportError(describeResult.GetReason()); - return; + return Finish(false, describeResult.GetReason()); } TString error; if (!BuildSchemeToUpload(describeResult, error)) { - reportError(error); - return; + return Finish(false, error); } if (auto permissions = NDataShard::GenYdbPermissions(describeResult.GetPathDescription())) { google::protobuf::TextFormat::PrintToString(permissions.GetRef(), &Permissions); } else { - reportError("cannot infer permissions"); - return; + return Finish(false, "cannot infer permissions"); } UploadScheme(); @@ -254,24 +245,19 @@ class TSchemeUploader: public TActorBootstrapped { void Bootstrap() { if (!DestinationPrefix) { - Finish(false, TStringBuilder() << "cannot determine destination prefix, item index: " << ItemIdx << " out of range"); - return; + return Finish(false, TStringBuilder() << "cannot determine destination prefix, item index: " << ItemIdx << " out of range"); } if (!Scheme || !Permissions) { - GetDescription(); - return; + return GetDescription(); } if (!SchemeUploaded) { - UploadScheme(); - return; + return UploadScheme(); } if (!PermissionsUploaded) { - UploadPermissions(); - return; + return UploadPermissions(); } if (!MetadataUploaded) { - UploadMetadata(); - return; + return UploadMetadata(); } Finish(); }