From 41d44b4150dc4a616731cc9969a49563c60283cb Mon Sep 17 00:00:00 2001 From: levy Date: Fri, 18 Dec 2020 13:23:46 +0800 Subject: [PATCH] fix --- include/dsn/utility/error_code.h | 1 - src/utils/flags.cpp | 4 ++-- src/utils/test/flag_test.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/dsn/utility/error_code.h b/include/dsn/utility/error_code.h index 81a08433b0..b6738db5b5 100644 --- a/include/dsn/utility/error_code.h +++ b/include/dsn/utility/error_code.h @@ -126,5 +126,4 @@ DEFINE_ERR_CODE(ERR_KRB5_INTERNAL) DEFINE_ERR_CODE(ERR_SASL_INTERNAL) DEFINE_ERR_CODE(ERR_SASL_INCOMPLETE) DEFINE_ERR_CODE(ERR_ACL_DENY) -DEFINE_ERR_CODE(ERR_NO_PERMISSION) } // namespace dsn diff --git a/src/utils/flags.cpp b/src/utils/flags.cpp index a6b47d4258..bf84e3ff0e 100644 --- a/src/utils/flags.cpp +++ b/src/utils/flags.cpp @@ -51,7 +51,7 @@ class flag_data #define FLAG_DATA_UPDATE_STRING() \ case FV_STRING: \ - return error_s::make(ERR_NO_PERMISSION, "string modifications are not supported") + return error_s::make(ERR_INVALID_PARAMETERS, "string modifications are not supported") void load() { @@ -74,7 +74,7 @@ class flag_data error_s update(const std::string &val) { if (!has_tag(flag_tag::FT_MUTABLE)) { - return error_s::make(ERR_NO_PERMISSION, fmt::format("{} is not mutable", _name)); + return error_s::make(ERR_INVALID_PARAMETERS, fmt::format("{} is not mutable", _name)); } switch (_type) { diff --git a/src/utils/test/flag_test.cpp b/src/utils/test/flag_test.cpp index 7b2f3a80f0..f67c3adaea 100644 --- a/src/utils/test/flag_test.cpp +++ b/src/utils/test/flag_test.cpp @@ -69,7 +69,7 @@ TEST(flag_test, update_config) // string modifications are not supported res = update_flag("test_string_immutable", "update_string"); - ASSERT_EQ(res.code(), ERR_NO_PERMISSION); + ASSERT_EQ(res.code(), ERR_INVALID_PARAMETERS); ASSERT_EQ(strcmp(FLAGS_test_string_immutable, "immutable_string"), 0); // test flag is not exist