add error reporting to DiscoverResponse; status text for errors.

and some more error codes.
This commit is contained in:
vyzo
2018-04-21 11:43:04 +03:00
parent 81e5078580
commit 9bdee4fffb

View File

@@ -158,16 +158,19 @@ message Message {
optional int64 ttl = 3; // in seconds
}
enum RegisterStatus {
OK = 0;
enum ResponseStatus {
OK = 0;
E_INVALID_NAMESPACE = 100;
E_INVALID_PEER_INFO = 101;
E_INVALID_TTL = 102;
E_INVALID_COOKIE = 103;
E_NOT_AUTHORIZED = 200;
E_INTERNAL_ERROR = 300;
}
message RegisterResponse {
optional RegisterStatus status = 1;
optional ResponseStatus status = 1;
optional string statusText = 2;
}
message Unregister {
@@ -184,6 +187,8 @@ message Message {
message DiscoverResponse {
repeated Register registrations = 1;
optional bytes cookie = 2;
optional ResponseStatus status = 3;
optional string statusText = 4;
}
optional MessageType type = 1;