diff options
author | Andrey Fomichev <andrey.fomichev@gmail.com> | 2022-06-11 17:03:57 +0300 |
---|---|---|
committer | Andrey Fomichev <andrey.fomichev@gmail.com> | 2022-06-11 17:03:57 +0300 |
commit | 4ef2b46d7bbdb7c091f3f69a43d0f8c2b073ada4 (patch) | |
tree | e7f1aaf4fa73eefe6eee4be6beb2c3e796c2624f | |
parent | 8195aedf490506f93f6ccacbbdafccf2f9799c07 (diff) | |
download | ydb-4ef2b46d7bbdb7c091f3f69a43d0f8c2b073ada4.tar.gz |
Fix misprint in class name (KIKIMR-15087)
ref:fdf80d9100372bb54d3489c4125ef10a9978b193
26 files changed, 94 insertions, 94 deletions
diff --git a/ydb/apps/ydb/main.cpp b/ydb/apps/ydb/main.cpp index 5f1621744b..61d7c859f8 100644 --- a/ydb/apps/ydb/main.cpp +++ b/ydb/apps/ydb/main.cpp @@ -14,7 +14,7 @@ int main(int argc, char **argv) { try { return NYdb::NConsoleClient::NewClient(argc, argv); } - catch (const NYdb::NConsoleClient::TMissUseException& e) { + catch (const NYdb::NConsoleClient::TMisuseException& e) { Cerr << e.what() << Endl; Cerr << "Try \"--help\" option for more info." << Endl; return EXIT_FAILURE; diff --git a/ydb/core/driver_lib/cli_base/cli_cmds_root.cpp b/ydb/core/driver_lib/cli_base/cli_cmds_root.cpp index 197eccfcfd..7c8f51b100 100644 --- a/ydb/core/driver_lib/cli_base/cli_cmds_root.cpp +++ b/ydb/core/driver_lib/cli_base/cli_cmds_root.cpp @@ -107,7 +107,7 @@ public: if (config.IsHelpCommand()) { return; } else { - throw TMissUseException() + throw TMisuseException() << "Missing required option 'server'. Also couldn't find 'host' variable in profile config."; } } diff --git a/ydb/core/driver_lib/run/main.cpp b/ydb/core/driver_lib/run/main.cpp index 606191acf1..48ff91633d 100644 --- a/ydb/core/driver_lib/run/main.cpp +++ b/ydb/core/driver_lib/run/main.cpp @@ -175,7 +175,7 @@ int ParameterizedMain(int argc, char **argv, std::shared_ptr<NKikimr::TModuleFac try { return NKikimr::Main(argc, argv, std::move(factories)); } - catch (const NYdb::NConsoleClient::TMissUseException& e) { + catch (const NYdb::NConsoleClient::TMisuseException& e) { Cerr << e.what() << Endl; Cerr << "Try \"--help\" option for more info." << Endl; return 1; diff --git a/ydb/public/lib/ydb_cli/commands/stock_workload.cpp b/ydb/public/lib/ydb_cli/commands/stock_workload.cpp index b706f75a3a..e00874b617 100644 --- a/ydb/public/lib/ydb_cli/commands/stock_workload.cpp +++ b/ydb/public/lib/ydb_cli/commands/stock_workload.cpp @@ -50,7 +50,7 @@ void TCommandStockInit::Parse(TConfig& config) { int TCommandStockInit::Run(TConfig& config) { if (ProductCount > 500'000) { - throw TMissUseException() << "Product count must be in range 1..500 000." << Endl; + throw TMisuseException() << "Product count must be in range 1..500 000." << Endl; } Driver = std::make_unique<NYdb::TDriver>(CreateDriver(config)); @@ -66,7 +66,7 @@ int TCommandStockInit::Run(TConfig& config) { NYdbWorkload::TWorkloadFactory factory; auto workloadGen = factory.GetWorkloadQueryGenerator("stock", ¶ms); if (workloadGen.get() == nullptr) { - throw TMissUseException() << "Invalid path to database." << Endl; + throw TMisuseException() << "Invalid path to database." << Endl; } auto session = GetSession(); @@ -133,7 +133,7 @@ int TCommandStockRunInsertRandomOrder::Run(TConfig& config) { NYdbWorkload::TWorkloadFactory factory; auto workloadGen = factory.GetWorkloadQueryGenerator("stock", ¶ms); if (workloadGen.get() == nullptr) { - throw TMissUseException() << "Invalid path to database." << Endl; + throw TMisuseException() << "Invalid path to database." << Endl; } return RunWorkload(workloadGen, static_cast<int>(NYdbWorkload::TStockWorkloadGenerator::EType::InsertRandomOrder)); @@ -167,7 +167,7 @@ int TCommandStockRunSubmitRandomOrder::Run(TConfig& config) { NYdbWorkload::TWorkloadFactory factory; auto workloadGen = factory.GetWorkloadQueryGenerator("stock", ¶ms); if (workloadGen.get() == nullptr) { - throw TMissUseException() << "Invalid path to database." << Endl; + throw TMisuseException() << "Invalid path to database." << Endl; } return RunWorkload(workloadGen, static_cast<int>(NYdbWorkload::TStockWorkloadGenerator::EType::SubmitRandomOrder)); @@ -201,7 +201,7 @@ int TCommandStockRunSubmitSameOrder::Run(TConfig& config) { NYdbWorkload::TWorkloadFactory factory; auto workloadGen = factory.GetWorkloadQueryGenerator("stock", ¶ms); if (workloadGen.get() == nullptr) { - throw TMissUseException() << "Invalid path to database." << Endl; + throw TMisuseException() << "Invalid path to database." << Endl; } return RunWorkload(workloadGen, static_cast<int>(NYdbWorkload::TStockWorkloadGenerator::EType::SubmitSameOrder)); @@ -235,7 +235,7 @@ int TCommandStockRunGetRandomCustomerHistory::Run(TConfig& config) { NYdbWorkload::TWorkloadFactory factory; auto workloadGen = factory.GetWorkloadQueryGenerator("stock", ¶ms); if (workloadGen.get() == nullptr) { - throw TMissUseException() << "Invalid path to database." << Endl; + throw TMisuseException() << "Invalid path to database." << Endl; } return RunWorkload(workloadGen, static_cast<int>(NYdbWorkload::TStockWorkloadGenerator::EType::GetRandomCustomerHistory)); @@ -269,7 +269,7 @@ int TCommandStockRunGetCustomerHistory::Run(TConfig& config) { NYdbWorkload::TWorkloadFactory factory; auto workloadGen = factory.GetWorkloadQueryGenerator("stock", ¶ms); if (workloadGen.get() == nullptr) { - throw TMissUseException() << "Invalid path to database." << Endl; + throw TMisuseException() << "Invalid path to database." << Endl; } return RunWorkload(workloadGen, static_cast<int>(NYdbWorkload::TStockWorkloadGenerator::EType::GetCustomerHistory)); diff --git a/ydb/public/lib/ydb_cli/commands/ydb_root_common.cpp b/ydb/public/lib/ydb_cli/commands/ydb_root_common.cpp index d0616beef3..181b01aa5e 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_root_common.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_root_common.cpp @@ -250,7 +250,7 @@ void TClientCommandRootCommon::ParseAddress(TConfig& config) { if (config.IsSystemCommand()) { return; } else { - throw TMissUseException() + throw TMisuseException() << "Missing required option 'endpoint'."; } } else { @@ -263,7 +263,7 @@ void TClientCommandRootCommon::ParseAddress(TConfig& config) { if (colon_pos == Address.rfind(":")) { config.Address = Address; } else { - throw TMissUseException() << "Wrong format for option 'endpoint': more than one colon found."; + throw TMisuseException() << "Wrong format for option 'endpoint': more than one colon found."; } } } @@ -274,7 +274,7 @@ void TClientCommandRootCommon::ParseProfile() { if (ProfileManager->HasProfile(ProfileName)) { Profile = ProfileManager->GetProfile(ProfileName); } else { - throw TMissUseException() << "Profile " << ProfileName << " does not exist." << Endl + throw TMisuseException() << "Profile " << ProfileName << " does not exist." << Endl << "Run \"ydb config profile list\" to see existing profiles"; } } @@ -293,12 +293,12 @@ void TClientCommandRootCommon::ParseDatabase(TConfig& config) { if (Database.empty()) { if (!config.IsSystemCommand()) { - throw TMissUseException() + throw TMisuseException() << "Missing required option 'database'."; } } else if (!Database.StartsWith('/')) { if (!config.IsSystemCommand()) { - throw TMissUseException() << "Path to a database \"" << Database + throw TMisuseException() << "Path to a database \"" << Database << "\" is incorrect. It must be absolute and thus must begin with '/'."; } } @@ -318,7 +318,7 @@ bool TClientCommandRootCommon::GetCredentialsFromProfile(std::shared_ptr<IProfil } auto authValue = profile->GetValue("authentication"); if (!authValue["method"]) { - throw TMissUseException() + throw TMisuseException() << "Configuration profile has \"authentication\" but does not has \"method\" in it"; } TString authMethod = authValue["method"].as<TString>(); @@ -341,10 +341,10 @@ bool TClientCommandRootCommon::GetCredentialsFromProfile(std::shared_ptr<IProfil knownMethod |= (authMethod == "static-credentials"); } if (!knownMethod) { - throw TMissUseException() << "Unknown authentication method in configuration profile: \"" << authMethod << "\""; + throw TMisuseException() << "Unknown authentication method in configuration profile: \"" << authMethod << "\""; } if (!authValue["data"]) { - throw TMissUseException() << "Active configuration profile has \"authentication\" with method \"" + throw TMisuseException() << "Active configuration profile has \"authentication\" with method \"" << authMethod << "\" in it, but no \"data\""; } auto authData = authValue["data"]; @@ -537,7 +537,7 @@ void TClientCommandRootCommon::ParseCredentials(TConfig& config) { str << " UseMetadataCredentials (true)"; } - throw TMissUseException() << str << ". Choose exactly one of them"; + throw TMisuseException() << str << ". Choose exactly one of them"; } if (config.UseStaticCredentials) { @@ -548,7 +548,7 @@ void TClientCommandRootCommon::ParseCredentials(TConfig& config) { } } else { if (config.StaticCredentials.Password) { - throw TMissUseException() << "User password was provided without user name"; + throw TMisuseException() << "User password was provided without user name"; } } } diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp index 7be1701ef1..f6bf872d63 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp @@ -145,7 +145,7 @@ void TCommandExportToYt::Parse(TConfig& config) { Items = TItem::Parse(config, "item"); if (Items.empty()) { - throw TMissUseException() << "At least one item should be provided"; + throw TMisuseException() << "At least one item should be provided"; } for (auto& item : Items) { @@ -283,7 +283,7 @@ void TCommandExportToS3::Parse(TConfig& config) { Items = TItem::Parse(config, "item"); if (Items.empty()) { - throw TMissUseException() << "At least one item should be provided"; + throw TMisuseException() << "At least one item should be provided"; } for (auto& item : Items) { diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp index b7d99642b3..846383dd20 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp @@ -86,7 +86,7 @@ void TCommandImportFromS3::Parse(TConfig& config) { Items = TItem::Parse(config, "item"); if (Items.empty()) { - throw TMissUseException() << "At least one item should be provided"; + throw TMisuseException() << "At least one item should be provided"; } for (auto& item : Items) { @@ -185,7 +185,7 @@ int TCommandImportFromCsv::Run(TConfig& config) { if (auto bytesPerRequest = NYdb::SizeFromString(BytesPerRequest)) { if (bytesPerRequest > TImportFileSettings::MaxBytesPerRequest) { - throw TMissUseException() + throw TMisuseException() << "--batch-bytes cannot be larger than " << HumanReadableSize(TImportFileSettings::MaxBytesPerRequest, SF_BYTES); } @@ -199,7 +199,7 @@ int TCommandImportFromCsv::Run(TConfig& config) { settings.MaxInFlightRequests(MaxInFlightRequests); if (Delimiter.size() != 1) { - throw TMissUseException() + throw TMisuseException() << "--delimiter should be a one symbol string. Got: '" << Delimiter << "'"; } else { settings.Delimiter(Delimiter); diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_operation.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_operation.cpp index 34ab009ca1..9c0a13e818 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_operation.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_operation.cpp @@ -61,7 +61,7 @@ void TCommandWithOperationId::Parse(TConfig& config) { try { OperationId = TOperationId(config.ParseResult->GetFreeArgs()[0]); } catch (const yexception& ex) { - throw TMissUseException() << "Invalid operation ID"; + throw TMisuseException() << "Invalid operation ID"; } } @@ -96,12 +96,12 @@ int TCommandGetOperation::Run(TConfig& config) { if (OperationId.GetSubKind() == "s3") { return GetOperation<NImport::TImportFromS3Response>(client, OperationId, OutputFormat); } else { - throw TMissUseException() << "Invalid operation ID (unexpected sub-kind of operation)"; + throw TMisuseException() << "Invalid operation ID (unexpected sub-kind of operation)"; } case Ydb::TOperationId::BUILD_INDEX: return GetOperation<NTable::TBuildIndexOperation>(client, OperationId, OutputFormat); default: - throw TMissUseException() << "Invalid operation ID (unexpected kind of operation)"; + throw TMisuseException() << "Invalid operation ID (unexpected kind of operation)"; } return EXIT_SUCCESS; @@ -184,7 +184,7 @@ void TCommandListOperations::Parse(TConfig& config) { Kind = config.ParseResult->GetFreeArgs()[0]; if (!KindToHandler.contains(Kind)) { - throw TMissUseException() << "Invalid kind. Use one of: " << KindChoices(); + throw TMisuseException() << "Invalid kind. Use one of: " << KindChoices(); } } diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp index cf62889c32..7ded54abf9 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp @@ -250,7 +250,7 @@ int TCommandDescribe::PrintStreamResponse(const NYdb::NPersQueue::TDescribeTopic case EOutputFormat::ProtoJsonBase64: return PrintStreamResponseProtoJsonBase64(result); default: - throw TMissUseException() << "This command doesn't support " << OutputFormat << " output format"; + throw TMisuseException() << "This command doesn't support " << OutputFormat << " output format"; } return EXIT_SUCCESS; } @@ -604,7 +604,7 @@ int TCommandDescribe::PrintTableResponse(NTable::TDescribeTableResult& result) { case EOutputFormat::ProtoJsonBase64: return PrintResponseProtoJsonBase64(tableDescription); default: - throw TMissUseException() << "This command doesn't support " << OutputFormat << " output format"; + throw TMisuseException() << "This command doesn't support " << OutputFormat << " output format"; } return EXIT_SUCCESS; } @@ -736,7 +736,7 @@ int TCommandList::Run(TConfig& config) { break; } default: - throw TMissUseException() << "This command doesn't support " << OutputFormat << " output format"; + throw TMisuseException() << "This command doesn't support " << OutputFormat << " output format"; } printer->Print(); return EXIT_SUCCESS; @@ -772,10 +772,10 @@ void TCommandPermissionGrant::Parse(TConfig& config) { ParsePath(config, 0); Subject = config.ParseResult->GetFreeArgs()[1]; if (!Subject) { - throw TMissUseException() << "Missing required argument <subject>"; + throw TMisuseException() << "Missing required argument <subject>"; } if (!PermissionsToGrant.size()) { - throw TMissUseException() << "At least one permission to grant should be provided"; + throw TMisuseException() << "At least one permission to grant should be provided"; } } @@ -813,10 +813,10 @@ void TCommandPermissionRevoke::Parse(TConfig& config) { ParsePath(config, 0); Subject = config.ParseResult->GetFreeArgs()[1]; if (!Subject) { - throw TMissUseException() << "Missing required argument <subject>"; + throw TMisuseException() << "Missing required argument <subject>"; } if (!PermissionsToRevoke.size()) { - throw TMissUseException() << "At least one permission to revoke should be provided"; + throw TMisuseException() << "At least one permission to revoke should be provided"; } } @@ -854,10 +854,10 @@ void TCommandPermissionSet::Parse(TConfig& config) { ParsePath(config, 0); Subject = config.ParseResult->GetFreeArgs()[1]; if (!Subject) { - throw TMissUseException() << "Missing required argument <subject>"; + throw TMisuseException() << "Missing required argument <subject>"; } if (!PermissionsToSet.size()) { - throw TMissUseException() << "At least one permission to set should be provided"; + throw TMisuseException() << "At least one permission to set should be provided"; } } @@ -892,7 +892,7 @@ void TCommandChangeOwner::Parse(TConfig& config) { ParsePath(config, 0); Owner = config.ParseResult->GetFreeArgs()[1]; if (!Owner){ - throw TMissUseException() << "Missing required argument <owner>"; + throw TMisuseException() << "Missing required argument <owner>"; } } diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_scripting.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_scripting.cpp index 4a25c372ce..df483057be 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_scripting.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_scripting.cpp @@ -66,11 +66,11 @@ void TCommandExecuteYqlScript::Parse(TConfig& config) { TClientCommand::Parse(config); ParseFormats(); if (!Script && !ScriptFile) { - throw TMissUseException() << "Neither \"Text of script\" (\"--script\", \"-s\") " + throw TMisuseException() << "Neither \"Text of script\" (\"--script\", \"-s\") " << "nor \"Path to file with script text\" (\"--file\", \"-f\") were provided."; } if (Script && ScriptFile) { - throw TMissUseException() << "Both mutually exclusive options \"Text of script\" (\"--script\", \"-s\") " + throw TMisuseException() << "Both mutually exclusive options \"Text of script\" (\"--script\", \"-s\") " << "and \"Path to file with script text\" (\"--file\", \"-f\") were provided."; } ParseParameters(); diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp index 7b4c9efa75..fecef5b324 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp @@ -51,11 +51,11 @@ namespace NYdb::NConsoleClient { for (const TString &codecStr : split) { auto exists = ExistingCodecs.find(to_lower(codecStr)); if (exists == ExistingCodecs.end()) { - throw TMissUseException() << "Supported codec " << codecStr << " is not available for this command"; + throw TMisuseException() << "Supported codec " << codecStr << " is not available for this command"; } if (std::find(AllowedCodecs_.begin(), AllowedCodecs_.end(), exists->second) == AllowedCodecs_.end()) { - throw TMissUseException() << "Supported codec " << codecStr << " is not available for this command"; + throw TMisuseException() << "Supported codec " << codecStr << " is not available for this command"; } SupportedCodecs_.push_back(exists->second); diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp index 5395b4994a..0746da4fb4 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp @@ -127,7 +127,7 @@ namespace { [&type](const std::pair<TString, EPrimitiveType>& it) { return it.first == type; } ); if (result == YdbPrimitives.end()) { - throw TMissUseException() << "Unknown type: " << type << Endl << "Allowed types: " << GetAllTypesString(); + throw TMisuseException() << "Unknown type: " << type << Endl << "Allowed types: " << GetAllTypesString(); } return result->second; } @@ -180,10 +180,10 @@ void TCommandCreateTable::Parse(TConfig& config) { TClientCommand::Parse(config); ParsePath(config, 0); if (!Columns.size()) { - throw TMissUseException() << "At least one column should be provided"; + throw TMisuseException() << "At least one column should be provided"; } if (!PrimaryKeys.size()) { - throw TMissUseException() << "At least one primary key should be provided"; + throw TMisuseException() << "At least one primary key should be provided"; } } @@ -193,7 +193,7 @@ int TCommandCreateTable::Run(TConfig& config) { TVector<TString> parts = StringSplitter(column).Split(':'); if (parts[1] == "Decimal") { if (parts.size() != 4 && parts.size() != 5) { - throw TMissUseException() << "Can't parse column \"" << column + throw TMisuseException() << "Can't parse column \"" << column << "\". Expected decimal format: \"<name>:Decimal:<precision>:<scale>[:<family>]\""; } TString family; @@ -207,7 +207,7 @@ int TCommandCreateTable::Run(TConfig& config) { ); } else { if (parts.size() != 2 && parts.size() != 3) { - throw TMissUseException() + throw TMisuseException() << "Can't parse column \"" << column << "\". Expected format: \"<name>:<type>[:<family>]\""; } TString family; @@ -221,13 +221,13 @@ int TCommandCreateTable::Run(TConfig& config) { for (const TString& index : Indexes) { TVector<TString> parts = StringSplitter(index).Split(':'); if (parts.size() != 2 || !parts[0] || !parts[1]) { - throw TMissUseException() << "Can't parse index \"" << index + throw TMisuseException() << "Can't parse index \"" << index << "\". Need exactly one colon. Expected format: \"<name>:<column1>[,<column2>,...]\""; } TVector<TString> columns = StringSplitter(parts[1]).Split(','); for (TString& column : columns) { if (!column) { - throw TMissUseException() << "Can't parse index \"" << index + throw TMisuseException() << "Can't parse index \"" << index << "\". Empty column names found. Expected format: \"<name>:<column1>[,<column2>,...]\""; } } @@ -259,7 +259,7 @@ int TCommandCreateTable::Run(TConfig& config) { if (AutoPartitioning == "AutoSplitMerge") { partitioningPolicy.AutoPartitioning(NTable::EAutoPartitioningPolicy::AutoSplitMerge); } else { - throw TMissUseException() << "Unknown auto-partitioning policy."; + throw TMisuseException() << "Unknown auto-partitioning policy."; } } } @@ -321,11 +321,11 @@ int TCommandDropTable::Run(TConfig& config) { void TCommandQueryBase::CheckQueryOptions() const { if (!Query && !QueryFile) { - throw TMissUseException() << "Neither \"Text of query\" (\"--query\", \"-q\") " + throw TMisuseException() << "Neither \"Text of query\" (\"--query\", \"-q\") " << "nor \"Path to file with query text\" (\"--file\", \"-f\") were provided."; } if (Query && QueryFile) { - throw TMissUseException() << "Both mutually exclusive options \"Text of query\" (\"--query\", \"-q\") " + throw TMisuseException() << "Both mutually exclusive options \"Text of query\" (\"--query\", \"-q\") " << "and \"Path to file with query text\" (\"--file\", \"-f\") were provided."; } } @@ -380,10 +380,10 @@ void TCommandExecuteQuery::Parse(TConfig& config) { TClientCommand::Parse(config); ParseFormats(); if (BasicStats && CollectStatsMode) { - throw TMissUseException() << "Both mutually exclusive options \"--stats\" and \"-s\" are provided."; + throw TMisuseException() << "Both mutually exclusive options \"--stats\" and \"-s\" are provided."; } if (ParameterOptions.size() && QueryType == "scheme") { - throw TMissUseException() << "Scheme queries does not support parameters."; + throw TMisuseException() << "Scheme queries does not support parameters."; } ParseParameters(); CheckQueryOptions(); @@ -402,7 +402,7 @@ int TCommandExecuteQuery::Run(TConfig& config) { return ExecuteScanQuery(config); } } - throw TMissUseException() << "Unknown query type."; + throw TMisuseException() << "Unknown query type."; } int TCommandExecuteQuery::ExecuteDataQuery(TConfig& config) { @@ -421,7 +421,7 @@ int TCommandExecuteQuery::ExecuteDataQuery(TConfig& config) { if (TxMode == "stale-ro") { txSettings = NTable::TTxSettings::StaleRO(); } else { - throw TMissUseException() << "Unknown transaction mode."; + throw TMisuseException() << "Unknown transaction mode."; } } } @@ -643,7 +643,7 @@ int TCommandExplain::Run(TConfig& config) { ast = result.GetAst(); } else { - throw TMissUseException() << "Unknown query type for explain."; + throw TMisuseException() << "Unknown query type for explain."; } if (PrintAst) { @@ -720,10 +720,10 @@ namespace { , NTable::TTableDescription& tableDescription) { NJson::TJsonValue jsonValue; if (!ReadJsonTree(jsonString, &jsonValue)) { - throw TMissUseException() << "Can't parse string \"" << jsonString << "\" (--" << optionName << " option) as json"; + throw TMisuseException() << "Can't parse string \"" << jsonString << "\" (--" << optionName << " option) as json"; } if (!jsonValue.IsArray()) { - throw TMissUseException() << "json string in \"--" << optionName + throw TMisuseException() << "json string in \"--" << optionName << "\" should contain array of elements representing tuple with key prefix, but it doesn't"; } TTypeBuilder typebuilder; @@ -733,7 +733,7 @@ namespace { for (const auto& element : jsonValue.GetArray()) { Y_UNUSED(element); if (pkColumnNamesIterator == pkColumnNames.end()) { - throw TMissUseException() << "json string in \"--" << optionName << "\" option contains more elements (" + throw TMisuseException() << "json string in \"--" << optionName << "\" option contains more elements (" << jsonValue.GetArray().size() << ") then columns in table primary key (" << pkColumnNames.size() << ")"; } for (const auto& column : tableDescription.GetTableColumns()) { @@ -779,7 +779,7 @@ int TCommandReadTable::Run(TConfig& config) { encoding = EBinaryStringEncoding::Base64; break; default: - throw TMissUseException() << "Unknown input format: " << InputFormat; + throw TMisuseException() << "Unknown input format: " << InputFormat; } if (From) { @@ -1030,7 +1030,7 @@ void TCommandTtlSet::Config(TConfig& config) { const auto value = NTable::TValueSinceUnixEpochModeSettings::UnitFromString(arg); if (value == NTable::TTtlSettings::EUnit::Unknown) { - throw TMissUseException() << "Unknown unit: " << arg << Endl << "Allowed units: " << allowedUnits; + throw TMisuseException() << "Unknown unit: " << arg << Endl << "Allowed units: " << allowedUnits; } ColumnUnit = value; diff --git a/ydb/public/lib/ydb_cli/commands/ydb_tools.cpp b/ydb/public/lib/ydb_cli/commands/ydb_tools.cpp index db4ec14d30..968e794a4d 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_tools.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_tools.cpp @@ -197,7 +197,7 @@ int TCommandRestore::Run(TConfig& config) { if (auto bytesPerRequest = NYdb::SizeFromString(BytesPerRequest)) { if (bytesPerRequest > NDump::TRestoreSettings::MaxBytesPerRequest) { - throw TMissUseException() + throw TMisuseException() << "--upload-batch-bytes cannot be larger than " << HumanReadableSize(NDump::TRestoreSettings::MaxBytesPerRequest, SF_BYTES); } @@ -258,7 +258,7 @@ void TCommandCopy::Parse(TConfig& config) { Items = TItem::Parse(config, "item"); if (Items.empty()) { - throw TMissUseException() << "At least one item should be provided"; + throw TMisuseException() << "At least one item should be provided"; } for (auto& item : Items) { @@ -348,7 +348,7 @@ void TCommandRename::Parse(TConfig& config) { Items = TItem::Parse(config, "item"); if (Items.empty()) { - throw TMissUseException() << "At least one item should be provided"; + throw TMisuseException() << "At least one item should be provided"; } for (auto& item : Items) { diff --git a/ydb/public/lib/ydb_cli/commands/ydb_yql.cpp b/ydb/public/lib/ydb_cli/commands/ydb_yql.cpp index ac8a256172..8ae31f970e 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_yql.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_yql.cpp @@ -41,11 +41,11 @@ void TCommandYql::Parse(TConfig& config) { TClientCommand::Parse(config); ParseFormats(); if (!Script && !ScriptFile) { - throw TMissUseException() << "Neither \"Text of script\" (\"--script\", \"-s\") " + throw TMisuseException() << "Neither \"Text of script\" (\"--script\", \"-s\") " << "nor \"Path to file with script text\" (\"--file\", \"-f\") were provided."; } if (Script && ScriptFile) { - throw TMissUseException() << "Both mutually exclusive options \"Text of script\" (\"--script\", \"-s\") " + throw TMisuseException() << "Both mutually exclusive options \"Text of script\" (\"--script\", \"-s\") " << "and \"Path to file with script text\" (\"--file\", \"-f\") were provided."; } if (ScriptFile) { diff --git a/ydb/public/lib/ydb_cli/common/aws.cpp b/ydb/public/lib/ydb_cli/common/aws.cpp index 8e73b772b9..2712c91954 100644 --- a/ydb/public/lib/ydb_cli/common/aws.cpp +++ b/ydb/public/lib/ydb_cli/common/aws.cpp @@ -38,7 +38,7 @@ static TStringBuf GetKey(TStringBuf content, const TString& key) { return line; } - throw TMissUseException() << "Cannot find \"" << key << "\" key"; + throw TMisuseException() << "Cannot find \"" << key << "\" key"; } void TCommandWithAwsCredentials::ReadAwsAccessKey() { diff --git a/ydb/public/lib/ydb_cli/common/command.cpp b/ydb/public/lib/ydb_cli/common/command.cpp index ce7334d738..bb16be4e49 100644 --- a/ydb/public/lib/ydb_cli/common/command.cpp +++ b/ydb/public/lib/ydb_cli/common/command.cpp @@ -367,7 +367,7 @@ void TCommandWithPath::ParsePath(const TClientCommand::TConfig& config, const si void TCommandWithPath::AdjustPath(const TClientCommand::TConfig& config) { if (!Path) { - throw TMissUseException() << "Missing required argument <path>"; + throw TMisuseException() << "Missing required argument <path>"; } NConsoleClient::AdjustPath(Path, config); diff --git a/ydb/public/lib/ydb_cli/common/command.h b/ydb/public/lib/ydb_cli/common/command.h index 56761b79e2..df9a65bde6 100644 --- a/ydb/public/lib/ydb_cli/common/command.h +++ b/ydb/public/lib/ydb_cli/common/command.h @@ -239,17 +239,17 @@ public: if (minFailed || maxFailed) { if (minSet && maxSet) { if (minValue == maxValue) { - throw TMissUseException() << "Command " << ArgV[0] + throw TMisuseException() << "Command " << ArgV[0] << " requires exactly " << minValue << " free arg(s)."; } - throw TMissUseException() << "Command " << ArgV[0] + throw TMisuseException() << "Command " << ArgV[0] << " requires from " << minValue << " to " << maxValue << " free arg(s)."; } if (minFailed) { - throw TMissUseException() << "Command " << ArgV[0] + throw TMisuseException() << "Command " << ArgV[0] << " requires at least " << minValue << " free arg(s)."; } - throw TMissUseException() << "Command " << ArgV[0] + throw TMisuseException() << "Command " << ArgV[0] << " requires at most " << maxValue << " free arg(s)."; } } diff --git a/ydb/public/lib/ydb_cli/common/common.h b/ydb/public/lib/ydb_cli/common/common.h index ffb8e4ea78..4156f2af74 100644 --- a/ydb/public/lib/ydb_cli/common/common.h +++ b/ydb/public/lib/ydb_cli/common/common.h @@ -9,7 +9,7 @@ namespace NYdb { namespace NConsoleClient { -class TMissUseException : public yexception {}; +class TMisuseException : public yexception {}; class TProfileConfig { public: diff --git a/ydb/public/lib/ydb_cli/common/format.cpp b/ydb/public/lib/ydb_cli/common/format.cpp index e40ef1df9f..39b01d6a01 100644 --- a/ydb/public/lib/ydb_cli/common/format.cpp +++ b/ydb/public/lib/ydb_cli/common/format.cpp @@ -100,7 +100,7 @@ void TCommandWithFormat::AddFormats(TClientCommand::TConfig& config, const TVect void TCommandWithFormat::ParseFormats() { if (InputFormat != EOutputFormat::Default && std::find(AllowedInputFormats.begin(), AllowedInputFormats.end(), InputFormat) == AllowedInputFormats.end()) { - throw TMissUseException() << "Input format " << InputFormat << " is not available for this command"; + throw TMisuseException() << "Input format " << InputFormat << " is not available for this command"; } @@ -108,7 +108,7 @@ void TCommandWithFormat::ParseFormats() { return; } if (std::find(AllowedFormats.begin(), AllowedFormats.end(), OutputFormat) == AllowedFormats.end()) { - throw TMissUseException() << "Output format " << OutputFormat << " is not available for this command"; + throw TMisuseException() << "Output format " << OutputFormat << " is not available for this command"; } } @@ -142,7 +142,7 @@ void TQueryPlanPrinter::Print(const TString& plan) { PrintJson(plan); break; default: - throw TMissUseException() << "This command doesn't support " << Format << " output format"; + throw TMisuseException() << "This command doesn't support " << Format << " output format"; } } @@ -302,7 +302,7 @@ void TResultSetPrinter::Print(const TResultSet& resultSet) { PrintCsv(resultSet); break; default: - throw TMissUseException() << "This command doesn't support " << Format << " output format"; + throw TMisuseException() << "This command doesn't support " << Format << " output format"; } } diff --git a/ydb/public/lib/ydb_cli/common/normalize_path.cpp b/ydb/public/lib/ydb_cli/common/normalize_path.cpp index 7ceec94045..85a16d17da 100644 --- a/ydb/public/lib/ydb_cli/common/normalize_path.cpp +++ b/ydb/public/lib/ydb_cli/common/normalize_path.cpp @@ -47,7 +47,7 @@ namespace NConsoleClient { void AdjustPath(TString& path, const TClientCommand::TConfig& config) { if (path.StartsWith('/')) { if (!path.StartsWith(config.Database)) { - throw TMissUseException() << "Provided path \"" << path << "\" starts with '/'. " + throw TMisuseException() << "Provided path \"" << path << "\" starts with '/'. " << "That means you are using an absolute path that should start with the path " << "to your database \"" << config.Database << "\", but it doesn't. " << Endl << "Please, provide full path starting from the domain root " diff --git a/ydb/public/lib/ydb_cli/common/normalize_path_ut.cpp b/ydb/public/lib/ydb_cli/common/normalize_path_ut.cpp index aae7cd7301..0f5ba890ad 100644 --- a/ydb/public/lib/ydb_cli/common/normalize_path_ut.cpp +++ b/ydb/public/lib/ydb_cli/common/normalize_path_ut.cpp @@ -30,8 +30,8 @@ Y_UNIT_TEST_SUITE(NormalizePathTest) { UNIT_ASSERT(AdjustPath("./abc", FakeConfig("/root/db")) == "/root/db/abc"); UNIT_ASSERT(AdjustPath("/root/db/abc", FakeConfig("/root/db")) == "/root/db/abc"); - UNIT_ASSERT_EXCEPTION(AdjustPath("/abc", FakeConfig("/root/db")), TMissUseException); - UNIT_ASSERT_EXCEPTION(AdjustPath("/root/bd/abc", FakeConfig("/root/db")), TMissUseException); + UNIT_ASSERT_EXCEPTION(AdjustPath("/abc", FakeConfig("/root/db")), TMisuseException); + UNIT_ASSERT_EXCEPTION(AdjustPath("/root/bd/abc", FakeConfig("/root/db")), TMisuseException); } } diff --git a/ydb/public/lib/ydb_cli/common/parameters.cpp b/ydb/public/lib/ydb_cli/common/parameters.cpp index f34620d1ea..3732e1837c 100644 --- a/ydb/public/lib/ydb_cli/common/parameters.cpp +++ b/ydb/public/lib/ydb_cli/common/parameters.cpp @@ -9,7 +9,7 @@ void TCommandWithParameters::ParseParameters() { for (const auto& parameterOption : ParameterOptions) { auto equalPos = parameterOption.find("="); if (equalPos == TString::npos) { - throw TMissUseException() << "Wrong parameter format for \"" << parameterOption + throw TMisuseException() << "Wrong parameter format for \"" << parameterOption << "\". Parameter option should have equal sign. Example (for linux):\n" << "--param '$input=1'"; } @@ -17,7 +17,7 @@ void TCommandWithParameters::ParseParameters() { auto paramName = parameterOption.substr(0, equalPos); if (!paramName.StartsWith('$') || equalPos <= 1) { - throw TMissUseException() << "Wrong parameter name \"" << paramName << "\" at option \"" + throw TMisuseException() << "Wrong parameter name \"" << paramName << "\" at option \"" << parameterOption << "\". " << "Parameter name should start with '$' sign. Example (for linux):\n" << "--param '$input=1'"; } @@ -73,14 +73,14 @@ TParams TCommandWithParameters::BuildParams(const std::map<TString, TType>& para encoding = EBinaryStringEncoding::Base64; break; default: - throw TMissUseException() << "Unknown input format: " << inputFormat; + throw TMisuseException() << "Unknown input format: " << inputFormat; } TParamsBuilder paramBuilder; for (const auto&[name, value] : Parameters) { auto paramIt = paramTypes.find(name); if (paramIt == paramTypes.end()) { - throw TMissUseException() << "Query does not contain parameter \"" << name << "\"."; + throw TMisuseException() << "Query does not contain parameter \"" << name << "\"."; } const TType& type = (*paramIt).second; paramBuilder.AddParam(name, JsonToYdbValue(value, type, encoding)); diff --git a/ydb/public/lib/ydb_cli/common/parseable_struct.h b/ydb/public/lib/ydb_cli/common/parseable_struct.h index 6eeb08ffba..29fe6269e2 100644 --- a/ydb/public/lib/ydb_cli/common/parseable_struct.h +++ b/ydb/public/lib/ydb_cli/common/parseable_struct.h @@ -43,10 +43,10 @@ class TParseableStruct { while (property.IsInited()) { if (const TString field = t.LoadProperty(property, buf.NextTok(','))) { if (!matched.insert(field).second) { - throw TMissUseException() << "Duplicate value for \"" << field << "\""; + throw TMisuseException() << "Duplicate value for \"" << field << "\""; } } else { - throw TMissUseException() << "Bad property: \"" << property << "\""; + throw TMisuseException() << "Bad property: \"" << property << "\""; } property = buf.NextTok('='); @@ -54,7 +54,7 @@ class TParseableStruct { for (auto it = Fields.begin(), last = Fields.end(); it != last; ++it) { if (it->second.Required && !matched.contains(it->first)) { - throw TMissUseException() << "Missing required property \"" << it->first << "\""; + throw TMisuseException() << "Missing required property \"" << it->first << "\""; } } diff --git a/ydb/public/lib/ydb_cli/common/query_stats.cpp b/ydb/public/lib/ydb_cli/common/query_stats.cpp index cab9dfaa2b..b53f8e746e 100644 --- a/ydb/public/lib/ydb_cli/common/query_stats.cpp +++ b/ydb/public/lib/ydb_cli/common/query_stats.cpp @@ -16,7 +16,7 @@ NTable::ECollectQueryStatsMode ParseQueryStatsMode(const TString& statsMode, } else if (statsMode == "full") { return NTable::ECollectQueryStatsMode::Full; } else { - throw TMissUseException() << "Unknown stats collection mode."; + throw TMisuseException() << "Unknown stats collection mode."; } } diff --git a/ydb/public/lib/ydb_cli/common/root.cpp b/ydb/public/lib/ydb_cli/common/root.cpp index e57c93a643..4637304645 100644 --- a/ydb/public/lib/ydb_cli/common/root.cpp +++ b/ydb/public/lib/ydb_cli/common/root.cpp @@ -77,7 +77,7 @@ void TClientCommandRootBase::ParseProtocol(TConfig& config) { } else if (protocol == "grpc") { config.EnableSsl = false; } else { - throw TMissUseException() << "Unknown protocol \"" << protocol << "\"."; + throw TMisuseException() << "Unknown protocol \"" << protocol << "\"."; } Address = Address.substr(separator_pos + 3); } @@ -88,7 +88,7 @@ void TClientCommandRootBase::ParseCaCerts(TConfig& config) { return; } if (!config.EnableSsl) { - throw TMissUseException() + throw TMisuseException() << "\"ca-file\" option provided for a non-ssl connection. Use grpcs:// prefix for host to connect using SSL."; } config.CaCerts = ReadFromFile(CaCertsFile, "CA certificates"); diff --git a/ydb/public/lib/ydb_cli/common/yt.cpp b/ydb/public/lib/ydb_cli/common/yt.cpp index 91c37eaec2..965dd0fab3 100644 --- a/ydb/public/lib/ydb_cli/common/yt.cpp +++ b/ydb/public/lib/ydb_cli/common/yt.cpp @@ -12,7 +12,7 @@ namespace NConsoleClient { void TCommandWithYtProxy::ParseYtProxy(const TString& proxy) { if (proxy.empty()) { - throw TMissUseException() << "No YT proxy provided."; + throw TMisuseException() << "No YT proxy provided."; } TMaybe<ui16> port; @@ -20,7 +20,7 @@ void TCommandWithYtProxy::ParseYtProxy(const TString& proxy) { try { Split(proxy, ':', YtHost, port); } catch (const yexception& ex) { - throw TMissUseException() << "Bad YT proxy format: \"" << proxy << "\"."; + throw TMisuseException() << "Bad YT proxy format: \"" << proxy << "\"."; } if (YtHost.find('.') == TString::npos && YtHost.find("localhost") == TString::npos) { |