Skip to content

Commit e4f93d8

Browse files
author
Diwaker Gupta
committed
Reduce indent for non-OK errors.
1 parent 6c7cde8 commit e4f93d8

File tree

6 files changed

+2188
-2188
lines changed

6 files changed

+2188
-2188
lines changed

dropbox/auth/client.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,29 +75,29 @@ func (dbx *apiImpl) TokenRevoke() (err error) {
7575
if dbx.Config.Verbose {
7676
log.Printf("body: %s", body)
7777
}
78-
if resp.StatusCode != http.StatusOK {
79-
if resp.StatusCode == http.StatusConflict {
80-
var apiError TokenRevokeAPIError
81-
err = json.Unmarshal(body, &apiError)
82-
if err != nil {
83-
return
84-
}
85-
err = apiError
86-
return
87-
}
88-
var apiError dropbox.APIError
89-
if resp.StatusCode == http.StatusBadRequest {
90-
apiError.ErrorSummary = string(body)
91-
err = apiError
92-
return
93-
}
78+
if resp.StatusCode == http.StatusOK {
79+
return
80+
}
81+
if resp.StatusCode == http.StatusConflict {
82+
var apiError TokenRevokeAPIError
9483
err = json.Unmarshal(body, &apiError)
9584
if err != nil {
9685
return
9786
}
9887
err = apiError
9988
return
10089
}
90+
var apiError dropbox.APIError
91+
if resp.StatusCode == http.StatusBadRequest {
92+
apiError.ErrorSummary = string(body)
93+
err = apiError
94+
return
95+
}
96+
err = json.Unmarshal(body, &apiError)
97+
if err != nil {
98+
return
99+
}
100+
err = apiError
101101
return
102102
}
103103

0 commit comments

Comments
 (0)