提交 6fd00d4a 编写于 作者: J Jingwen Owen Ou

Move default case to the first line of FormatError

上级 cdf9b757
......@@ -474,6 +474,8 @@ func (client *Client) apiHost() string {
func FormatError(action string, err error) (ee error) {
switch e := err.(type) {
default:
ee = err
case *octokit.ResponseError:
statusCode := e.Response.StatusCode
var reason string
......@@ -504,8 +506,6 @@ func FormatError(action string, err error) (ee error) {
case *AuthError:
errStr := fmt.Sprintf("Error %s: Unauthorized (HTTP 401)", action)
ee = fmt.Errorf(errStr)
default:
ee = err
}
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册