编译器状态码详解

# 编译器状态码详解 本文档列举了编译器返回的状态码及相应说明。 返回信息: 1. code: 状态码 2. type: 报错类型 (报错描述最为简单的) 3. subtype: 次级报错类型 (报错描述会稍微详细一点,指向第二层级的) 4. detail: 报错细则(报错描述再详细一点) 5. trace: 报错路径,报错描述最详细的,包含了具体的报错路径信息,后台人员可以用来debug 示例: ```json { "code":2203, "success":false, "time": "Thu May 6 14:55:12 2021", "data":{ "type":"编译异常", "subtype":"遍历器异常-节点遍历异常", "detail":"没有找到出口点", "trace":返回e.printStackTrace()的结果 } } ``` ## (一)返回成功 #### 状态码:**1** 信息 - Success 含义 - 该状态码表示已创建。成功请求并创建了新的资源,该请求已经被实现。 ## (二)返回失败 > ### 0. 未知异常 #### 错误码:**0** 类名 - UnknownException(msg: String, cause:Throwable?=null) 信息 - 未知异常,发生了非预期的异常。 #### 错误码:**2000** 类名 - CompilerUnknownException(msg: String, cause:Throwable?=null) 信息 - 未知编译异常,发生了非预期的异常。 #### 错误码:**3000** 类名 - DecompilerException(msg: String, cause:Throwable?=null) 信息 - 未知反编译异常,发生了非预期的异常。 > ### 1. 通用异常 #### 错误码:**1000** 类名 - CommonException(code:Int, type:String, subtype:String, detail: String, cause:Throwable?) 信息 - 通用异常 ##### 1.1 权限异常: ###### 1.1.1 权限异常 ###### 错误码:**1101** 类名 - PermissionsException(code:Int, type:String, subtype:String, detail: String, cause:Throwable?) ###### 1.1.2 登录异常 ###### 错误码:**1102** 类名 - LoginException(code:Int, type:String, subtype:String, detail: String, cause:Throwable?) ##### 1.2 增加异常: ###### 1.2.1 增加服务异常 ###### 错误码:**1201** 类名 - GetServiceReferenceException(code:Int, type:String, subtype:String, detail: String, cause:Throwable?) ##### 1.3 删除异常: ###### 1.3.1 删除服务异常 ###### 错误码:**1201** 类名 - CommonException(code:Int, type:String, subtype:String, detail: String, cause:Throwable?) ##### 1.4 修改异常: ###### 1.4.1 修改服务异常 ###### 错误码:**1401** 类名 - CommonException(code:Int, type:String, subtype:String, detail: String, cause:Throwable?) ##### 1.5 查询异常: ##### 错误码:**5000** 类名 - QueryException(code:Int, type:String, subtype:String, detail: String, cause:Throwable?) ###### 1.5.1 查询服务参数异常 ###### 错误码:**1501** 类名 - QueryServiceParametersException(code:Int, type:String, subtype:String, detail: String, cause:Throwable?) > ### 2. 编译异常 > #### 解析器异常 ##### 错误码:**2100** 类名 - CompilerParsingUnknownException(msg:String="", cause:Throwable?=null) 信息 - 未知解析异常,发生了非预期的异常。 ##### 错误码:**2101** 类名 - CompilerParsingGraphException(msg:String="", cause:Throwable?=null) 信息 - 图结构解析异常。 ##### 错误码:**2102** 类名 - CompilerParsingEdgesException(msg:String="", cause:Throwable?=null) 信息 - 边集合解析异常。 ##### 错误码:**2103** 类名 - CompilerParsingNodesException(msg:String="", cause:Throwable?=null): 信息 - 点集合解析异常。 ##### 错误码:**2104** 类名 - CompilerParsingEdgeException(msg:String="", cause:Throwable?=null) 信息 - 结点解析异常。 ##### 错误码:**2105** 类名 - CompilerParsingNodeException(msg:String="", cause:Throwable?=null) 信息 - 边解析异常。 ##### 错误码:**2106** 类名 - CompilerParsingExpressionException(msg:String="", cause:Throwable?=null) 信息 - 表达式解析异常。 > #### 遍历器异常 ##### 错误码:**2200** 类名 - CompilerWalkingUnknownException(msg:String="", cause:Throwable?=null) 信息 - 未知遍历异常。 ##### 错误码:**2201** 类名 - CompilerWalkingGraphException(msg:String="", cause:Throwable?=null) 信息 - 图遍历异常。 ##### 错误码:**2202** 类名 - CompilerWalkingEdgesException(msg:String="", cause:Throwable?=null) 信息 - 边遍历异常。 ##### 错误码:**2203** 类名 - CompilerWalkingNodesException(msg:String="", cause:Throwable?=null) 信息 - 结点遍历异常。 ##### 错误码:**2204** 类名 - CompilerWalkingExpressionException(msg:String="", cause:Throwable?=null) 信息 - 表达式遍历异常。 > #### 访问器异常 ##### 错误码:**2300** 类名 - CompilerVisitingUnknownException(msg:String="", cause:Throwable?=null) 信息 - 未知解析异常。 ##### 错误码:**2301** 类名 - CompilerVisitingGraphException(msg:String="", cause:Throwable?=null) 信息 - 图解析异常。 ##### 错误码:**2302** 类名 - CompilerVisitingEdgesException(msg:String="", cause:Throwable?=null) 信息 - 边解析异常。 ##### 错误码:**2303** 类名 - CompilerVisitingNodesException(msg:String="", cause:Throwable?=null) 信息 - 节点解析异常。 ##### 错误码:**2304** 类名 - CompilerVisitingExpressionException(msg:String="", cause:Throwable?=null) 信息 - 表达式解析异常。 > #### 渲染器异常 ##### 错误码:**2400** 类名 - CompilerRenderingUnknownException(msg:String="", cause:Throwable?=null) 信息 - 未知渲染异常。 ##### 错误码:**2401** 类名 - CompilerRenderingGraphException(msg:String="", cause:Throwable?=null) 信息 - 图渲染异常。 ##### 错误码:**2402** 类名 - CompilerRenderingEdgesException(msg:String="", cause:Throwable?=null) 信息 - 边渲染异常。 ##### 错误码:**2403** 类名 - CompilerRenderingNodesException(msg:String="", cause:Throwable?=null) 信息 - 结点渲染异常。 ##### 错误码:**2404** 类名 - CompilerRenderingExpressionException(msg:String="", cause:Throwable?=null) 信息 - 表达式渲染异常。 > ### 3. 反编译异常 #### 错误码:**3000** 类名 - DecompilerException(code:Int, subtype:String, detail: String, cause:Throwable?) 信息 - 反编译异常 > ### 4. 原生异常 #### 错误码:**999** 类名 - TException(code:Int, type:String, subtype: String, detail: String, cause:Throwable?) 信息 - 原生异常