无尽光芒

Tars错误码解释

2022.10.14


// TARS定义的返回码

const int TARSSERVERSUCCESS = 0; //服务器端处理成功
const int TARSSERVERDECODEERR = -1; //服务器端解码异常
解码异常可以考虑是不是用到了复杂的对象,目前来说换成string 是没问题的。


const int TARSSERVERENCODEERR = -2; //服务器端编码异常
const int TARSSERVERNOFUNCERR = -3; //服务器端没有该函数
const int TARSSERVERNOSERVANTERR = -4; //服务器端没有该Servant对象
const int TARSSERVERRESETGRID = -5; //服务器端灰度状态不一致
const int TARSSERVERQUEUETIMEOUT = -6; //服务器队列超过限制
const int TARSASYNCCALLTIMEOUT = -7; //异步调用超时
const int TARSINVOKETIMEOUT = -7; //调用超时
const int TARSPROXYCONNECTERR = -8; //proxy链接异常
const int TARSSERVEROVERLOAD = -9; //服务器端超负载,超过队列长度
const int TARSADAPTERNULL = -10; //客户端选路为空,服务不存在或者所有服务down掉了
const int TARSINVOKEBYINVALIDESET = -11; //客户端按set规则调用非法
const int TARSCLIENTDECODEERR = -12; //客户端解码异常
const int TARSSERVERUNKNOWNERR = -99; //服务器端位置异常

// 定义按位的消息状态类型,可复合

const int TARSMESSAGETYPENULL = 0x00; //无状态
const int TARSMESSAGETYPEHASH = 0x01; //HASH消息
const int TARSMESSAGETYPEGRID = 0x02; //灰度消息
const int TARSMESSAGETYPEDYED = 0x04; //染色消息
const int TARSMESSAGETYPESAMPLE = 0x08; //stat采样消息
const int TARSMESSAGETYPEASYNC = 0x10; //异步调用程序
//const int TARSMESSAGETYPELOADED = 0x20; //按负载值调用程序
//const int TARSMESSAGETYPESETED = 0x40; //按set规则调用类型,此字段后面将不使用
const int TARSMESSAGETYPESETNAME = 0x80; //按setname规则调用类型
const int TARSMESSAGETYPETRACK = 0x100; //track调用链消息