Skip to content

Commit 4609c33

Browse files
refactor: Rename kind to code in error handling structures
1 parent 3d78985 commit 4609c33

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/operations/dispatcher.cppm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ constexpr auto dispatch(Lhs const &lhs, Rhs const &rhs)
132132
!underlying::traits<typename meta::rhs_value_type>::is_valid_rep(
133133
rhs_rep_raw)) {
134134
policy::error::request<common_rep> request{};
135-
request.kind = policy::error::kind::domain_error;
135+
request.code = policy::error::kind::domain_error;
136136
request.reason = "invalid underlying representation";
137137
return runtime::resolve_error<typename meta::error_policy, OpTag,
138138
common_rep, ErrorPayload>(request);

src/operations/invoker.cppm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ constexpr auto make_error(policy::error::kind kind, char const *reason,
2727
-> policy::value::decision<CommonRep> {
2828
policy::value::decision<CommonRep> out{};
2929
out.has_value = false;
30-
out.error.kind = kind;
30+
out.error.code = kind;
3131
out.error.reason = reason;
3232
out.error.lhs_value = lhs;
3333
out.error.rhs_value = rhs;
@@ -385,7 +385,7 @@ struct op_binding {
385385
-> policy::value::decision<CommonRep> {
386386
policy::value::decision<CommonRep> out{};
387387
out.has_value = false;
388-
out.error.kind = policy::error::kind::unspecified;
388+
out.error.code = policy::error::kind::unspecified;
389389
out.error.reason = "operation binding is not implemented";
390390
return out;
391391
}

src/policy/handler.cppm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enum class kind : unsigned char {
2828
};
2929

3030
template <typename CommonRep> struct request {
31-
kind kind = kind::none;
31+
kind code = kind::none;
3232
std::string_view reason{};
3333
std::optional<CommonRep> lhs_value{};
3434
std::optional<CommonRep> rhs_value{};

src/policy/impl.cppm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ struct error::handler<error::expected, OpTag, CommonRep, ErrorPayload> {
280280

281281
static constexpr auto resolve(request_type const &request) -> result_type {
282282
return std::unexpected(
283-
details::to_error_payload<ErrorPayload>(request.kind));
283+
details::to_error_payload<ErrorPayload>(request.code));
284284
}
285285
};
286286

0 commit comments

Comments
 (0)