From 841235b3b5ff828d1a282a0abac2d97eb2d52f0c Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Thu, 25 Jun 2015 15:10:24 +0900 Subject: [PATCH] WIP: bugfixes, add {error, written} --- src/machi.proto | 1 + src/machi_pb_high_client.erl | 2 ++ src/machi_pb_wrap.erl | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/machi.proto b/src/machi.proto index dbf5237..c3f40f8 100644 --- a/src/machi.proto +++ b/src/machi.proto @@ -42,6 +42,7 @@ enum Mpb_GeneralStatusCode { BAD_CHECKSUM = 3; PARTITION = 4; NOT_WRITTEN = 5; + WRITTEN = 6; BAD_JOSS = 255; // Only for testing by the Taipan } diff --git a/src/machi_pb_high_client.erl b/src/machi_pb_high_client.erl index bd42741..abec13c 100644 --- a/src/machi_pb_high_client.erl +++ b/src/machi_pb_high_client.erl @@ -367,6 +367,8 @@ convert_general_status_code('PARTITION') -> {error, partition}; convert_general_status_code('NOT_WRITTEN') -> {error, not_written}; +convert_general_status_code('WRITTEN') -> + {error, written}; convert_general_status_code('BAD_JOSS') -> throw({error, bad_joss_taipan_fixme}). diff --git a/src/machi_pb_wrap.erl b/src/machi_pb_wrap.erl index be089ab..9daa54c 100644 --- a/src/machi_pb_wrap.erl +++ b/src/machi_pb_wrap.erl @@ -365,6 +365,8 @@ conv_from_status({error, partition}) -> 'PARTITION'; conv_from_status({error, not_written}) -> 'NOT_WRITTEN'; +conv_from_status({error, written}) -> + 'WRITTEN'; conv_from_status(_OOPS) -> io:format(user, "HEY, ~s:~w got ~w\n", [?MODULE, ?LINE, _OOPS]), 'BAD_JOSS'.