mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Improve error handling in integration clients
This commit is contained in:
parent
b270159aae
commit
fb49ad24d5
3 changed files with 15 additions and 3 deletions
|
@ -31,11 +31,15 @@ func (c *Client) AddURL(link, title string) error {
|
|||
clt := client.New(apiURL)
|
||||
clt.WithCredentials(c.username, c.password)
|
||||
response, err := clt.Get()
|
||||
if err != nil {
|
||||
return fmt.Errorf("instapaper: unable to send url: %v", err)
|
||||
}
|
||||
|
||||
if response.HasServerFailure() {
|
||||
return fmt.Errorf("instapaper: unable to send url, status=%d", response.StatusCode)
|
||||
}
|
||||
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewClient returns a new Instapaper client.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue