bug fixed
This commit is contained in:
parent
cd6dbe0429
commit
84c971ac62
|
@ -2,177 +2,174 @@ use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
pub struct Error {
|
pub struct Error {
|
||||||
#[prost(int32, tag="1")]
|
#[prost(int32, tag = "1")]
|
||||||
pub code: i32,
|
pub code: i32,
|
||||||
#[prost(string, tag="2")]
|
#[prost(string, tag = "2")]
|
||||||
pub message: ::prost::alloc::string::String,
|
pub message: ::prost::alloc::string::String,
|
||||||
#[prost(bytes="vec", optional, tag="3")]
|
#[prost(bytes = "vec", optional, tag = "3")]
|
||||||
pub data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
|
pub data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for Error {
|
impl fmt::Display for Error {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"Error code: {}, message: {:?}, data: {:?}",
|
"Error code: {}, message: {:?}, data: {:?}",
|
||||||
self.code, self.message, self.data
|
self.code, self.message, self.data
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Error {
|
|
||||||
pub const PARSE: i32 = -32700;
|
|
||||||
pub const INVALID_REQUEST: i32 = -32600;
|
|
||||||
pub const INVALID_PARAMS: i32 = -32602;
|
|
||||||
pub const INTERNAL: i32 = -32603;
|
|
||||||
pub const SERVER_00: i32 = -32000;
|
|
||||||
pub const SERVER_01: i32 = -32001;
|
|
||||||
pub const SERVER_02: i32 = -32002;
|
|
||||||
pub const SERVER_03: i32 = -32003;
|
|
||||||
pub const SERVER_04: i32 = -32004;
|
|
||||||
pub const SERVER_05: i32 = -32005;
|
|
||||||
pub const SERVER_06: i32 = -32006;
|
|
||||||
pub const SERVER_07: i32 = -32007;
|
|
||||||
pub const SERVER_08: i32 = -32008;
|
|
||||||
pub const SERVER_09: i32 = -32009;
|
|
||||||
pub const SERVER_10: i32 = -32010;
|
|
||||||
pub const SERVER_11: i32 = -32011;
|
|
||||||
pub const SERVER_12: i32 = -32012;
|
|
||||||
pub const SERVER_13: i32 = -32013;
|
|
||||||
pub const SERVER_14: i32 = -32014;
|
|
||||||
pub const SERVER_15: i32 = -32015;
|
|
||||||
pub const SERVER_16: i32 = -32016;
|
|
||||||
pub const SERVER_17: i32 = -32017;
|
|
||||||
pub const SERVER_18: i32 = -32018;
|
|
||||||
pub const SERVER_19: i32 = -32019;
|
|
||||||
pub const SERVER_20: i32 = -32020;
|
|
||||||
pub const SERVER_21: i32 = -32021;
|
|
||||||
pub const SERVER_22: i32 = -32022;
|
|
||||||
pub const SERVER_23: i32 = -32023;
|
|
||||||
pub const SERVER_24: i32 = -32024;
|
|
||||||
pub const SERVER_25: i32 = -32025;
|
|
||||||
pub const SERVER_26: i32 = -32026;
|
|
||||||
pub const SERVER_27: i32 = -32027;
|
|
||||||
pub const SERVER_28: i32 = -32028;
|
|
||||||
pub const SERVER_29: i32 = -32029;
|
|
||||||
pub const SERVER_30: i32 = -32030;
|
|
||||||
pub const SERVER_31: i32 = -32031;
|
|
||||||
pub const SERVER_32: i32 = -32032;
|
|
||||||
pub const SERVER_33: i32 = -32033;
|
|
||||||
pub const SERVER_34: i32 = -32034;
|
|
||||||
pub const SERVER_35: i32 = -32035;
|
|
||||||
pub const SERVER_36: i32 = -32036;
|
|
||||||
pub const SERVER_37: i32 = -32037;
|
|
||||||
pub const SERVER_38: i32 = -32038;
|
|
||||||
pub const SERVER_39: i32 = -32039;
|
|
||||||
pub const SERVER_40: i32 = -32040;
|
|
||||||
pub const SERVER_41: i32 = -32041;
|
|
||||||
pub const SERVER_42: i32 = -32042;
|
|
||||||
pub const SERVER_43: i32 = -32043;
|
|
||||||
pub const SERVER_44: i32 = -32044;
|
|
||||||
pub const SERVER_45: i32 = -32045;
|
|
||||||
pub const SERVER_46: i32 = -32046;
|
|
||||||
pub const SERVER_47: i32 = -32047;
|
|
||||||
pub const SERVER_48: i32 = -32048;
|
|
||||||
pub const SERVER_49: i32 = -32049;
|
|
||||||
pub const SERVER_50: i32 = -32050;
|
|
||||||
pub const SERVER_51: i32 = -32051;
|
|
||||||
pub const SERVER_52: i32 = -32052;
|
|
||||||
pub const SERVER_53: i32 = -32053;
|
|
||||||
pub const SERVER_54: i32 = -32054;
|
|
||||||
pub const SERVER_55: i32 = -32055;
|
|
||||||
pub const SERVER_56: i32 = -32056;
|
|
||||||
pub const SERVER_57: i32 = -32057;
|
|
||||||
pub const SERVER_58: i32 = -32058;
|
|
||||||
pub const SERVER_59: i32 = -32059;
|
|
||||||
pub const SERVER_60: i32 = -32060;
|
|
||||||
pub const SERVER_61: i32 = -32061;
|
|
||||||
pub const SERVER_62: i32 = -32062;
|
|
||||||
pub const SERVER_63: i32 = -32063;
|
|
||||||
pub const SERVER_64: i32 = -32064;
|
|
||||||
pub const SERVER_65: i32 = -32065;
|
|
||||||
pub const SERVER_66: i32 = -32066;
|
|
||||||
pub const SERVER_67: i32 = -32067;
|
|
||||||
pub const SERVER_68: i32 = -32068;
|
|
||||||
pub const SERVER_69: i32 = -32069;
|
|
||||||
pub const SERVER_70: i32 = -32070;
|
|
||||||
pub const SERVER_71: i32 = -32071;
|
|
||||||
pub const SERVER_72: i32 = -32072;
|
|
||||||
pub const SERVER_73: i32 = -32073;
|
|
||||||
pub const SERVER_74: i32 = -32074;
|
|
||||||
pub const SERVER_75: i32 = -32075;
|
|
||||||
pub const SERVER_76: i32 = -32076;
|
|
||||||
pub const SERVER_77: i32 = -32077;
|
|
||||||
pub const SERVER_78: i32 = -32078;
|
|
||||||
pub const SERVER_79: i32 = -32079;
|
|
||||||
pub const SERVER_80: i32 = -32080;
|
|
||||||
pub const SERVER_81: i32 = -32081;
|
|
||||||
pub const SERVER_82: i32 = -32082;
|
|
||||||
pub const SERVER_83: i32 = -32083;
|
|
||||||
pub const SERVER_84: i32 = -32084;
|
|
||||||
pub const SERVER_85: i32 = -32085;
|
|
||||||
pub const SERVER_86: i32 = -32086;
|
|
||||||
pub const SERVER_87: i32 = -32087;
|
|
||||||
pub const SERVER_88: i32 = -32088;
|
|
||||||
pub const SERVER_89: i32 = -32089;
|
|
||||||
pub const SERVER_90: i32 = -32090;
|
|
||||||
pub const SERVER_91: i32 = -32091;
|
|
||||||
pub const SERVER_92: i32 = -32092;
|
|
||||||
pub const SERVER_93: i32 = -32093;
|
|
||||||
pub const SERVER_94: i32 = -32094;
|
|
||||||
pub const SERVER_95: i32 = -32095;
|
|
||||||
pub const SERVER_96: i32 = -32096;
|
|
||||||
pub const SERVER_97: i32 = -32097;
|
|
||||||
pub const SERVER_98: i32 = -32098;
|
|
||||||
pub const SERVER_99: i32 = -32099;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Error {
|
||||||
|
pub const PARSE: i32 = -32700;
|
||||||
|
pub const INVALID_REQUEST: i32 = -32600;
|
||||||
|
pub const INVALID_PARAMS: i32 = -32602;
|
||||||
|
pub const INTERNAL: i32 = -32603;
|
||||||
|
pub const SERVER_00: i32 = -32000;
|
||||||
|
pub const SERVER_01: i32 = -32001;
|
||||||
|
pub const SERVER_02: i32 = -32002;
|
||||||
|
pub const SERVER_03: i32 = -32003;
|
||||||
|
pub const SERVER_04: i32 = -32004;
|
||||||
|
pub const SERVER_05: i32 = -32005;
|
||||||
|
pub const SERVER_06: i32 = -32006;
|
||||||
|
pub const SERVER_07: i32 = -32007;
|
||||||
|
pub const SERVER_08: i32 = -32008;
|
||||||
|
pub const SERVER_09: i32 = -32009;
|
||||||
|
pub const SERVER_10: i32 = -32010;
|
||||||
|
pub const SERVER_11: i32 = -32011;
|
||||||
|
pub const SERVER_12: i32 = -32012;
|
||||||
|
pub const SERVER_13: i32 = -32013;
|
||||||
|
pub const SERVER_14: i32 = -32014;
|
||||||
|
pub const SERVER_15: i32 = -32015;
|
||||||
|
pub const SERVER_16: i32 = -32016;
|
||||||
|
pub const SERVER_17: i32 = -32017;
|
||||||
|
pub const SERVER_18: i32 = -32018;
|
||||||
|
pub const SERVER_19: i32 = -32019;
|
||||||
|
pub const SERVER_20: i32 = -32020;
|
||||||
|
pub const SERVER_21: i32 = -32021;
|
||||||
|
pub const SERVER_22: i32 = -32022;
|
||||||
|
pub const SERVER_23: i32 = -32023;
|
||||||
|
pub const SERVER_24: i32 = -32024;
|
||||||
|
pub const SERVER_25: i32 = -32025;
|
||||||
|
pub const SERVER_26: i32 = -32026;
|
||||||
|
pub const SERVER_27: i32 = -32027;
|
||||||
|
pub const SERVER_28: i32 = -32028;
|
||||||
|
pub const SERVER_29: i32 = -32029;
|
||||||
|
pub const SERVER_30: i32 = -32030;
|
||||||
|
pub const SERVER_31: i32 = -32031;
|
||||||
|
pub const SERVER_32: i32 = -32032;
|
||||||
|
pub const SERVER_33: i32 = -32033;
|
||||||
|
pub const SERVER_34: i32 = -32034;
|
||||||
|
pub const SERVER_35: i32 = -32035;
|
||||||
|
pub const SERVER_36: i32 = -32036;
|
||||||
|
pub const SERVER_37: i32 = -32037;
|
||||||
|
pub const SERVER_38: i32 = -32038;
|
||||||
|
pub const SERVER_39: i32 = -32039;
|
||||||
|
pub const SERVER_40: i32 = -32040;
|
||||||
|
pub const SERVER_41: i32 = -32041;
|
||||||
|
pub const SERVER_42: i32 = -32042;
|
||||||
|
pub const SERVER_43: i32 = -32043;
|
||||||
|
pub const SERVER_44: i32 = -32044;
|
||||||
|
pub const SERVER_45: i32 = -32045;
|
||||||
|
pub const SERVER_46: i32 = -32046;
|
||||||
|
pub const SERVER_47: i32 = -32047;
|
||||||
|
pub const SERVER_48: i32 = -32048;
|
||||||
|
pub const SERVER_49: i32 = -32049;
|
||||||
|
pub const SERVER_50: i32 = -32050;
|
||||||
|
pub const SERVER_51: i32 = -32051;
|
||||||
|
pub const SERVER_52: i32 = -32052;
|
||||||
|
pub const SERVER_53: i32 = -32053;
|
||||||
|
pub const SERVER_54: i32 = -32054;
|
||||||
|
pub const SERVER_55: i32 = -32055;
|
||||||
|
pub const SERVER_56: i32 = -32056;
|
||||||
|
pub const SERVER_57: i32 = -32057;
|
||||||
|
pub const SERVER_58: i32 = -32058;
|
||||||
|
pub const SERVER_59: i32 = -32059;
|
||||||
|
pub const SERVER_60: i32 = -32060;
|
||||||
|
pub const SERVER_61: i32 = -32061;
|
||||||
|
pub const SERVER_62: i32 = -32062;
|
||||||
|
pub const SERVER_63: i32 = -32063;
|
||||||
|
pub const SERVER_64: i32 = -32064;
|
||||||
|
pub const SERVER_65: i32 = -32065;
|
||||||
|
pub const SERVER_66: i32 = -32066;
|
||||||
|
pub const SERVER_67: i32 = -32067;
|
||||||
|
pub const SERVER_68: i32 = -32068;
|
||||||
|
pub const SERVER_69: i32 = -32069;
|
||||||
|
pub const SERVER_70: i32 = -32070;
|
||||||
|
pub const SERVER_71: i32 = -32071;
|
||||||
|
pub const SERVER_72: i32 = -32072;
|
||||||
|
pub const SERVER_73: i32 = -32073;
|
||||||
|
pub const SERVER_74: i32 = -32074;
|
||||||
|
pub const SERVER_75: i32 = -32075;
|
||||||
|
pub const SERVER_76: i32 = -32076;
|
||||||
|
pub const SERVER_77: i32 = -32077;
|
||||||
|
pub const SERVER_78: i32 = -32078;
|
||||||
|
pub const SERVER_79: i32 = -32079;
|
||||||
|
pub const SERVER_80: i32 = -32080;
|
||||||
|
pub const SERVER_81: i32 = -32081;
|
||||||
|
pub const SERVER_82: i32 = -32082;
|
||||||
|
pub const SERVER_83: i32 = -32083;
|
||||||
|
pub const SERVER_84: i32 = -32084;
|
||||||
|
pub const SERVER_85: i32 = -32085;
|
||||||
|
pub const SERVER_86: i32 = -32086;
|
||||||
|
pub const SERVER_87: i32 = -32087;
|
||||||
|
pub const SERVER_88: i32 = -32088;
|
||||||
|
pub const SERVER_89: i32 = -32089;
|
||||||
|
pub const SERVER_90: i32 = -32090;
|
||||||
|
pub const SERVER_91: i32 = -32091;
|
||||||
|
pub const SERVER_92: i32 = -32092;
|
||||||
|
pub const SERVER_93: i32 = -32093;
|
||||||
|
pub const SERVER_94: i32 = -32094;
|
||||||
|
pub const SERVER_95: i32 = -32095;
|
||||||
|
pub const SERVER_96: i32 = -32096;
|
||||||
|
pub const SERVER_97: i32 = -32097;
|
||||||
|
pub const SERVER_98: i32 = -32098;
|
||||||
|
pub const SERVER_99: i32 = -32099;
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
pub struct InvalidParamsDetail {
|
pub struct InvalidParamsDetail {
|
||||||
#[prost(string, tag="1")]
|
#[prost(string, tag = "1")]
|
||||||
pub location: ::prost::alloc::string::String,
|
pub location: ::prost::alloc::string::String,
|
||||||
#[prost(string, tag="2")]
|
#[prost(string, tag = "2")]
|
||||||
pub param: ::prost::alloc::string::String,
|
pub param: ::prost::alloc::string::String,
|
||||||
#[prost(string, tag="3")]
|
#[prost(string, tag = "3")]
|
||||||
pub value: ::prost::alloc::string::String,
|
pub value: ::prost::alloc::string::String,
|
||||||
#[prost(enumeration="InvalidParamsType", tag="4")]
|
#[prost(enumeration = "InvalidParamsType", tag = "4")]
|
||||||
pub error_type: i32,
|
pub error_type: i32,
|
||||||
#[prost(string, tag="5")]
|
#[prost(string, tag = "5")]
|
||||||
pub message: ::prost::alloc::string::String,
|
pub message: ::prost::alloc::string::String,
|
||||||
}
|
}
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
||||||
#[repr(i32)]
|
#[repr(i32)]
|
||||||
pub enum InvalidParamsType {
|
pub enum InvalidParamsType {
|
||||||
None = 0,
|
None = 0,
|
||||||
DateTime = 1,
|
DateTime = 1,
|
||||||
Decimal = 2,
|
Decimal = 2,
|
||||||
EqualsTo = 3,
|
EqualsTo = 3,
|
||||||
Float = 4,
|
Float = 4,
|
||||||
Integer = 5,
|
Integer = 5,
|
||||||
Range = 6,
|
Range = 6,
|
||||||
RegEx = 7,
|
RegEx = 7,
|
||||||
Required = 8,
|
Required = 8,
|
||||||
StringLength = 9,
|
StringLength = 9,
|
||||||
Url = 10,
|
Url = 10,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl From<i32> for InvalidParamsType {
|
impl From<i32> for InvalidParamsType {
|
||||||
fn from(s: i32) -> Self {
|
fn from(s: i32) -> Self {
|
||||||
match s {
|
match s {
|
||||||
s if s == InvalidParamsType::DateTime as i32 => InvalidParamsType::DateTime,
|
s if s == InvalidParamsType::DateTime as i32 => InvalidParamsType::DateTime,
|
||||||
s if s == InvalidParamsType::Decimal as i32 => InvalidParamsType::Decimal,
|
s if s == InvalidParamsType::Decimal as i32 => InvalidParamsType::Decimal,
|
||||||
s if s == InvalidParamsType::EqualsTo as i32 => InvalidParamsType::EqualsTo,
|
s if s == InvalidParamsType::EqualsTo as i32 => InvalidParamsType::EqualsTo,
|
||||||
s if s == InvalidParamsType::Float as i32 => InvalidParamsType::Float,
|
s if s == InvalidParamsType::Float as i32 => InvalidParamsType::Float,
|
||||||
s if s == InvalidParamsType::Integer as i32 => InvalidParamsType::Integer,
|
s if s == InvalidParamsType::Integer as i32 => InvalidParamsType::Integer,
|
||||||
s if s == InvalidParamsType::Range as i32 => InvalidParamsType::Range,
|
s if s == InvalidParamsType::Range as i32 => InvalidParamsType::Range,
|
||||||
s if s == InvalidParamsType::RegEx as i32 => InvalidParamsType::RegEx,
|
s if s == InvalidParamsType::RegEx as i32 => InvalidParamsType::RegEx,
|
||||||
s if s == InvalidParamsType::Required as i32 => InvalidParamsType::Required,
|
s if s == InvalidParamsType::Required as i32 => InvalidParamsType::Required,
|
||||||
s if s == InvalidParamsType::StringLength as i32 => InvalidParamsType::StringLength,
|
s if s == InvalidParamsType::StringLength as i32 => InvalidParamsType::StringLength,
|
||||||
s if s == InvalidParamsType::Url as i32 => InvalidParamsType::Url,
|
s if s == InvalidParamsType::Url as i32 => InvalidParamsType::Url,
|
||||||
_ => InvalidParamsType::None,
|
_ => InvalidParamsType::None,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user