Skip to content

Commit 6a3ce45

Browse files
committed
Gateway to backend API: add default error code
Added to avoid any issue in future when adding new error codes. It will not solve issue with old backends (using protobuf without this line) but it will make upgrade easier after that.
1 parent 95a9dce commit 6a3ce45

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gateway_to_backend/protocol_buffers_files/error.proto

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ package wirepas.proto.gateway_api;
44

55
enum ErrorCode {
66
option allow_alias = true;
7+
// First enum code is the one returned in case error code
8+
// is unknown on the other side (new added values in future)
9+
// To avoid having OK as default code, better to use an explicit UNKNOWN_ERROR_CODE.
10+
// It will become the default only for the one using a protobuf file that has this
11+
// error code defined.
12+
// This unknown error code should never be explicitly set from a gateway but used
13+
// only by parser when the error code set is unknown
14+
UNKNOWN_ERROR_CODE = -1;
715
OK = 0;
816
INTERNAL_ERROR = 1;
917
INVALID_SINK_ID = 2;

0 commit comments

Comments
 (0)