8000 client如何区分 客户端error、服务器error、服务器panic · Issue #1781 · cloudwego/kitex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
client如何区分 客户端error、服务器error、服务器panic #1781
Closed
@ziyyun

Description

@ziyyun

在Middleware,可以区分客户端error、服务器error、服务器panic,对于非业务类的错误,直接panic。

例如:
user, err := client.GetUser(userId)
if user == nil {
添加用户
} else {
对当前用户操作
}

希望非业务量错误,client.GetUser直接panic,不希望业务代码里面参杂太多异常处理。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0