|
@@ -51,7 +51,7 @@ impl DocError {
|
|
|
self.code
|
|
|
}
|
|
|
pub fn clear_code(&mut self) {
|
|
|
- self.code = ErrorCode::DocIdInvalid;
|
|
|
+ self.code = ErrorCode::WsConnectError;
|
|
|
}
|
|
|
|
|
|
// Param is passed by value, moved
|
|
@@ -113,7 +113,7 @@ impl ::protobuf::Message for DocError {
|
|
|
#[allow(unused_variables)]
|
|
|
fn compute_size(&self) -> u32 {
|
|
|
let mut my_size = 0;
|
|
|
- if self.code != ErrorCode::DocIdInvalid {
|
|
|
+ if self.code != ErrorCode::WsConnectError {
|
|
|
my_size += ::protobuf::rt::enum_size(1, self.code);
|
|
|
}
|
|
|
if !self.msg.is_empty() {
|
|
@@ -125,7 +125,7 @@ impl ::protobuf::Message for DocError {
|
|
|
}
|
|
|
|
|
|
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
|
|
- if self.code != ErrorCode::DocIdInvalid {
|
|
|
+ if self.code != ErrorCode::WsConnectError {
|
|
|
os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.code))?;
|
|
|
}
|
|
|
if !self.msg.is_empty() {
|
|
@@ -195,7 +195,7 @@ impl ::protobuf::Message for DocError {
|
|
|
|
|
|
impl ::protobuf::Clear for DocError {
|
|
|
fn clear(&mut self) {
|
|
|
- self.code = ErrorCode::DocIdInvalid;
|
|
|
+ self.code = ErrorCode::WsConnectError;
|
|
|
self.msg.clear();
|
|
|
self.unknown_fields.clear();
|
|
|
}
|
|
@@ -215,13 +215,9 @@ impl ::protobuf::reflect::ProtobufValue for DocError {
|
|
|
|
|
|
#[derive(Clone,PartialEq,Eq,Debug,Hash)]
|
|
|
pub enum ErrorCode {
|
|
|
- DocIdInvalid = 0,
|
|
|
+ WsConnectError = 0,
|
|
|
DocNotfound = 1,
|
|
|
- WsConnectError = 10,
|
|
|
- UndoFail = 200,
|
|
|
- RedoFail = 201,
|
|
|
- OutOfBound = 202,
|
|
|
- DuplicateRevision = 400,
|
|
|
+ DuplicateRevision = 2,
|
|
|
UserUnauthorized = 999,
|
|
|
InternalError = 1000,
|
|
|
}
|
|
@@ -233,13 +229,9 @@ impl ::protobuf::ProtobufEnum for ErrorCode {
|
|
|
|
|
|
fn from_i32(value: i32) -> ::std::option::Option<ErrorCode> {
|
|
|
match value {
|
|
|
- 0 => ::std::option::Option::Some(ErrorCode::DocIdInvalid),
|
|
|
+ 0 => ::std::option::Option::Some(ErrorCode::WsConnectError),
|
|
|
1 => ::std::option::Option::Some(ErrorCode::DocNotfound),
|
|
|
- 10 => ::std::option::Option::Some(ErrorCode::WsConnectError),
|
|
|
- 200 => ::std::option::Option::Some(ErrorCode::UndoFail),
|
|
|
- 201 => ::std::option::Option::Some(ErrorCode::RedoFail),
|
|
|
- 202 => ::std::option::Option::Some(ErrorCode::OutOfBound),
|
|
|
- 400 => ::std::option::Option::Some(ErrorCode::DuplicateRevision),
|
|
|
+ 2 => ::std::option::Option::Some(ErrorCode::DuplicateRevision),
|
|
|
999 => ::std::option::Option::Some(ErrorCode::UserUnauthorized),
|
|
|
1000 => ::std::option::Option::Some(ErrorCode::InternalError),
|
|
|
_ => ::std::option::Option::None
|
|
@@ -248,12 +240,8 @@ impl ::protobuf::ProtobufEnum for ErrorCode {
|
|
|
|
|
|
fn values() -> &'static [Self] {
|
|
|
static values: &'static [ErrorCode] = &[
|
|
|
- ErrorCode::DocIdInvalid,
|
|
|
- ErrorCode::DocNotfound,
|
|
|
ErrorCode::WsConnectError,
|
|
|
- ErrorCode::UndoFail,
|
|
|
- ErrorCode::RedoFail,
|
|
|
- ErrorCode::OutOfBound,
|
|
|
+ ErrorCode::DocNotfound,
|
|
|
ErrorCode::DuplicateRevision,
|
|
|
ErrorCode::UserUnauthorized,
|
|
|
ErrorCode::InternalError,
|
|
@@ -274,7 +262,7 @@ impl ::std::marker::Copy for ErrorCode {
|
|
|
|
|
|
impl ::std::default::Default for ErrorCode {
|
|
|
fn default() -> Self {
|
|
|
- ErrorCode::DocIdInvalid
|
|
|
+ ErrorCode::WsConnectError
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -286,39 +274,29 @@ impl ::protobuf::reflect::ProtobufValue for ErrorCode {
|
|
|
|
|
|
static file_descriptor_proto_data: &'static [u8] = b"\
|
|
|
\n\x0cerrors.proto\"<\n\x08DocError\x12\x1e\n\x04code\x18\x01\x20\x01(\
|
|
|
- \x0e2\n.ErrorCodeR\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03msg*\
|
|
|
- \xb4\x01\n\tErrorCode\x12\x10\n\x0cDocIdInvalid\x10\0\x12\x0f\n\x0bDocNo\
|
|
|
- tfound\x10\x01\x12\x12\n\x0eWsConnectError\x10\n\x12\r\n\x08UndoFail\x10\
|
|
|
- \xc8\x01\x12\r\n\x08RedoFail\x10\xc9\x01\x12\x0f\n\nOutOfBound\x10\xca\
|
|
|
- \x01\x12\x16\n\x11DuplicateRevision\x10\x90\x03\x12\x15\n\x10UserUnautho\
|
|
|
- rized\x10\xe7\x07\x12\x12\n\rInternalError\x10\xe8\x07J\xa1\x04\n\x06\
|
|
|
- \x12\x04\0\0\x10\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\
|
|
|
+ \x0e2\n.ErrorCodeR\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03msg*r\
|
|
|
+ \n\tErrorCode\x12\x12\n\x0eWsConnectError\x10\0\x12\x0f\n\x0bDocNotfound\
|
|
|
+ \x10\x01\x12\x15\n\x11DuplicateRevision\x10\x02\x12\x15\n\x10UserUnautho\
|
|
|
+ rized\x10\xe7\x07\x12\x12\n\rInternalError\x10\xe8\x07J\xfd\x02\n\x06\
|
|
|
+ \x12\x04\0\0\x0c\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\
|
|
|
\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x10\n\x0b\n\x04\
|
|
|
\x04\0\x02\0\x12\x03\x03\x04\x17\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x03\
|
|
|
\x04\r\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0e\x12\n\x0c\n\x05\x04\0\
|
|
|
\x02\0\x03\x12\x03\x03\x15\x16\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\
|
|
|
\x13\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\
|
|
|
\x02\x01\x01\x12\x03\x04\x0b\x0e\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\
|
|
|
- \x04\x11\x12\n\n\n\x02\x05\0\x12\x04\x06\0\x10\x01\n\n\n\x03\x05\0\x01\
|
|
|
- \x12\x03\x06\x05\x0e\n\x0b\n\x04\x05\0\x02\0\x12\x03\x07\x04\x15\n\x0c\n\
|
|
|
- \x05\x05\0\x02\0\x01\x12\x03\x07\x04\x10\n\x0c\n\x05\x05\0\x02\0\x02\x12\
|
|
|
- \x03\x07\x13\x14\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x08\x04\x14\n\x0c\n\
|
|
|
+ \x04\x11\x12\n\n\n\x02\x05\0\x12\x04\x06\0\x0c\x01\n\n\n\x03\x05\0\x01\
|
|
|
+ \x12\x03\x06\x05\x0e\n\x0b\n\x04\x05\0\x02\0\x12\x03\x07\x04\x17\n\x0c\n\
|
|
|
+ \x05\x05\0\x02\0\x01\x12\x03\x07\x04\x12\n\x0c\n\x05\x05\0\x02\0\x02\x12\
|
|
|
+ \x03\x07\x15\x16\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x08\x04\x14\n\x0c\n\
|
|
|
\x05\x05\0\x02\x01\x01\x12\x03\x08\x04\x0f\n\x0c\n\x05\x05\0\x02\x01\x02\
|
|
|
- \x12\x03\x08\x12\x13\n\x0b\n\x04\x05\0\x02\x02\x12\x03\t\x04\x18\n\x0c\n\
|
|
|
- \x05\x05\0\x02\x02\x01\x12\x03\t\x04\x12\n\x0c\n\x05\x05\0\x02\x02\x02\
|
|
|
- \x12\x03\t\x15\x17\n\x0b\n\x04\x05\0\x02\x03\x12\x03\n\x04\x13\n\x0c\n\
|
|
|
- \x05\x05\0\x02\x03\x01\x12\x03\n\x04\x0c\n\x0c\n\x05\x05\0\x02\x03\x02\
|
|
|
- \x12\x03\n\x0f\x12\n\x0b\n\x04\x05\0\x02\x04\x12\x03\x0b\x04\x13\n\x0c\n\
|
|
|
- \x05\x05\0\x02\x04\x01\x12\x03\x0b\x04\x0c\n\x0c\n\x05\x05\0\x02\x04\x02\
|
|
|
- \x12\x03\x0b\x0f\x12\n\x0b\n\x04\x05\0\x02\x05\x12\x03\x0c\x04\x15\n\x0c\
|
|
|
- \n\x05\x05\0\x02\x05\x01\x12\x03\x0c\x04\x0e\n\x0c\n\x05\x05\0\x02\x05\
|
|
|
- \x02\x12\x03\x0c\x11\x14\n\x0b\n\x04\x05\0\x02\x06\x12\x03\r\x04\x1c\n\
|
|
|
- \x0c\n\x05\x05\0\x02\x06\x01\x12\x03\r\x04\x15\n\x0c\n\x05\x05\0\x02\x06\
|
|
|
- \x02\x12\x03\r\x18\x1b\n\x0b\n\x04\x05\0\x02\x07\x12\x03\x0e\x04\x1b\n\
|
|
|
- \x0c\n\x05\x05\0\x02\x07\x01\x12\x03\x0e\x04\x14\n\x0c\n\x05\x05\0\x02\
|
|
|
- \x07\x02\x12\x03\x0e\x17\x1a\n\x0b\n\x04\x05\0\x02\x08\x12\x03\x0f\x04\
|
|
|
- \x19\n\x0c\n\x05\x05\0\x02\x08\x01\x12\x03\x0f\x04\x11\n\x0c\n\x05\x05\0\
|
|
|
- \x02\x08\x02\x12\x03\x0f\x14\x18b\x06proto3\
|
|
|
+ \x12\x03\x08\x12\x13\n\x0b\n\x04\x05\0\x02\x02\x12\x03\t\x04\x1a\n\x0c\n\
|
|
|
+ \x05\x05\0\x02\x02\x01\x12\x03\t\x04\x15\n\x0c\n\x05\x05\0\x02\x02\x02\
|
|
|
+ \x12\x03\t\x18\x19\n\x0b\n\x04\x05\0\x02\x03\x12\x03\n\x04\x1b\n\x0c\n\
|
|
|
+ \x05\x05\0\x02\x03\x01\x12\x03\n\x04\x14\n\x0c\n\x05\x05\0\x02\x03\x02\
|
|
|
+ \x12\x03\n\x17\x1a\n\x0b\n\x04\x05\0\x02\x04\x12\x03\x0b\x04\x19\n\x0c\n\
|
|
|
+ \x05\x05\0\x02\x04\x01\x12\x03\x0b\x04\x11\n\x0c\n\x05\x05\0\x02\x04\x02\
|
|
|
+ \x12\x03\x0b\x14\x18b\x06proto3\
|
|
|
";
|
|
|
|
|
|
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|