Skip to content

Commit

Permalink
Refactor pgyer publisher to handle error response
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinGong2013 committed Jun 21, 2024
1 parent 1951035 commit 6488009
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/pgyer/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ func (c *Client) Do(req shared.PublishRequest) error {
Message string `json:"message"`
}

if resp.Code != 0 {
return fmt.Errorf("get cos token failed. %s", resp.Message)
}

resp.Data.Params["key"] = resp.Data.Key

r, err := c.restyClient.R().
SetFormData(resp.Data.Params).
SetFile("file", req.ApkFile).
Expand Down

0 comments on commit 6488009

Please sign in to comment.