Skip to content

Commit

Permalink
add http process
Browse files Browse the repository at this point in the history
  • Loading branch information
empiredan committed Dec 26, 2024
1 parent 661e8c8 commit 0f9e6ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/client/replication_ddl_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/meta/meta_http_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0f9e6ff

Please sign in to comment.