Skip to content

Commit

Permalink
todo
Browse files Browse the repository at this point in the history
  • Loading branch information
achamayou committed Mar 13, 2023
1 parent b6b35db commit d3bc780
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/node/rpc/frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ namespace ccf
HTTP_STATUS_INTERNAL_SERVER_ERROR,
ccf::errors::InternalError,
"Illegal endpoint implementation");
// TODO: clear headers
return;
}
// else args owns a valid Tx relating to a non-pending response, which
Expand Down Expand Up @@ -574,6 +575,7 @@ namespace ccf
fmt::format(
"Failed to execute local commit handler func: {}",
e.what()));
// TODO: clear headers
}
catch (...)
{
Expand All @@ -584,6 +586,7 @@ namespace ccf
HTTP_STATUS_INTERNAL_SERVER_ERROR,
ccf::errors::InternalError,
"Failed to execute local commit handler func");
// TODO: clear headers
}
}

Expand All @@ -609,6 +612,7 @@ namespace ccf
HTTP_STATUS_SERVICE_UNAVAILABLE,
ccf::errors::TransactionReplicationFailed,
"Transaction failed to replicate.");
// TODO: clear headers
update_metrics(ctx);
return;
}
Expand All @@ -625,20 +629,23 @@ namespace ccf
catch (RpcException& e)
{
ctx->set_error(std::move(e.error));
// TODO: clear headers
update_metrics(ctx);
return;
}
catch (const JsonParseError& e)
{
ctx->set_error(
HTTP_STATUS_BAD_REQUEST, ccf::errors::InvalidInput, e.describe());
// TODO: clear headers
update_metrics(ctx);
return;
}
catch (const nlohmann::json::exception& e)
{
ctx->set_error(
HTTP_STATUS_BAD_REQUEST, ccf::errors::InvalidInput, e.what());
// TODO: clear headers
update_metrics(ctx);
return;
}
Expand All @@ -657,6 +664,7 @@ namespace ccf
HTTP_STATUS_INTERNAL_SERVER_ERROR,
ccf::errors::InternalError,
e.what());
// TODO: clear headers
update_metrics(ctx);
return;
}
Expand All @@ -669,6 +677,7 @@ namespace ccf
"Transaction continued to conflict after {} attempts. Retry "
"later.",
max_attempts));
// TODO: clear headers
static constexpr size_t retry_after_seconds = 3;
ctx->set_response_header(http::headers::RETRY_AFTER, retry_after_seconds);

Expand Down

0 comments on commit d3bc780

Please sign in to comment.