summaryrefslogtreecommitdiff
path: root/src/codec-json
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2023-07-01 12:18:57 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2023-07-01 12:18:57 +0200
commit9d237c68b7ce6cdefc645daad5fa1fc57a2d80be (patch)
tree26bb3bbada0a23df7ed1501f3dd5454d49732a8d /src/codec-json
parent84de66e6147d2fb50f84001a297cf941083849f9 (diff)
c++,core,codec-json: Changed an error
Diffstat (limited to 'src/codec-json')
-rw-r--r--src/codec-json/json.tmpl.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/codec-json/json.tmpl.h b/src/codec-json/json.tmpl.h
index 9a28fe9..2bbfa5d 100644
--- a/src/codec-json/json.tmpl.h
+++ b/src/codec-json/json.tmpl.h
@@ -71,7 +71,6 @@ struct json_encode<schema::String, RootSchema, FromEncode> {
template<typename... T, typename RootSchema, typename FromEncode>
struct json_encode<schema::Tuple<T...>, RootSchema, FromEncode> {
-
template<size_t i>
static error_or<void> encode_element(const data<schema::Tuple<T...>, FromEncode>& from, buffer& to){
auto eov = json_encode<typename parameter_pack_type<i, T...>::type, RootSchema, FromEncode>::encode(from.template get<i>(), to);
@@ -484,9 +483,7 @@ struct json_decode<schema::Struct<schema::Member<T,Lits>...>, RootSchema, ToDeco
constexpr static string_literal Literal = parameter_key_pack_type<i, Lits...>::literal;
if(search_name == Literal.view()){
if(fields[i]){
- // TODO Change to this. Maybe
- // return make_error<err::already_exists>();
- return make_error<err::invalid_state>();
+ return make_error<err::already_exists>();
}
fields[i] = true;
auto eov = json_decode<Type, RootSchema, ToDecode>::decode(buff, to.template get<Literal>());