buffet: Report command instance parsing error to cloud server
When a command comes from GCD server and fails to parse, we used to
just skip the command without reporting anything to the server.
This lead to the same command coming down in the next fetch cycle and
be retried over and over again.
Now if buffet cannot process a command, we mark it as "aborted" on the
server and provide actual failure reason - in the "error" property of
the command resource.
BUG=brillo:952
TEST=`FEATURES=test emerge-buffet`
Tested manually on device through GCD dev site.
Change-Id: Idcda5ca296696a01d7e008f148f125c1a4ed1072
Reviewed-on: https://chromium-review.googlesource.com/268442
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
diff --git a/buffet/commands/schema_constants.h b/buffet/commands/schema_constants.h
index 9740303..fbbb3e3 100644
--- a/buffet/commands/schema_constants.h
+++ b/buffet/commands/schema_constants.h
@@ -56,6 +56,8 @@
extern const char kCommand_Results[];
extern const char kCommand_State[];
extern const char kCommand_Progress[];
+extern const char kCommand_ErrorCode[];
+extern const char kCommand_ErrorMessage[];
extern const char kCommand_Visibility[];
extern const char kCommand_Visibility_None[];