diff --git a/src/client/replication_ddl_client.cpp b/src/client/replication_ddl_client.cpp index cd90c166b4..34ef8d5260 100644 --- a/src/client/replication_ddl_client.cpp +++ b/src/client/replication_ddl_client.cpp @@ -303,7 +303,7 @@ error_s replication_ddl_client::list_apps(dsn::app_status::type status, } if (resp.err != dsn::ERR_OK) { - return FMT_ERR(resp.err, resp.hint_message); + return error_s::make(resp.err, resp.hint_message); } apps = std::move(resp.infos); @@ -425,7 +425,7 @@ error_s replication_ddl_client::list_apps(bool show_all, const auto &err = list_app(info.app_name, app_id, partition_count, pcs); if (err != ERR_OK) { LOG_ERROR("list app({}) failed, err={}", info.app_name, err); - return FMT_ERR(err, ""); + return error_s::make(err); } CHECK_EQ(info.app_id, app_id); CHECK_EQ(info.partition_count, partition_count); diff --git a/src/meta/meta_http_service.cpp b/src/meta/meta_http_service.cpp index a7efe0e221..94e0cfb328 100644 --- a/src/meta/meta_http_service.cpp +++ b/src/meta/meta_http_service.cpp @@ -52,6 +52,7 @@ #include "server_load_balancer.h" #include "server_state.h" #include "utils/error_code.h" +#include "utils/errors.h" #include "utils/flags.h" #include "utils/fmt_logging.h" #include "utils/output_utils.h" @@ -229,7 +230,7 @@ void meta_http_service::list_app_handler(const http_request &req, http_response _service->_state->list_apps(request, response); if (response.err != dsn::ERR_OK) { - resp.body = response.err; + resp.body = error_s::make(response.err, response.hint_message).description(); resp.status_code = http_status_code::kInternalServerError; return; } @@ -524,7 +525,7 @@ void meta_http_service::get_app_envs_handler(const http_request &req, http_respo request.status = dsn::app_status::AS_AVAILABLE; _service->_state->list_apps(request, response); if (response.err != dsn::ERR_OK) { - resp.body = response.err.to_string(); + resp.body = error_s::make(response.err, response.hint_message).description(); resp.status_code = http_status_code::kInternalServerError; return; }