Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
levy5307 committed Dec 18, 2020
1 parent a0af437 commit 41d44b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion include/dsn/utility/error_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/utils/flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/test/flag_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41d44b4

Please sign in to comment.