aboutsummaryrefslogtreecommitdiffhomepage
path: root/integration/nunuxkeeper/nunuxkeeper.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-05-21 12:24:48 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-05-21 19:58:36 -0400
commitfb49ad24d5418ee9b7f65e9c36f07a1717608fcb (patch)
treebc4efdab54442f36405ea069f89fde1accf1c349 /integration/nunuxkeeper/nunuxkeeper.go
parentb270159aae97359afe02f3c4843fa0f4e9a1a1b6 (diff)
Improve error handling in integration clients
Diffstat (limited to 'integration/nunuxkeeper/nunuxkeeper.go')
-rw-r--r--integration/nunuxkeeper/nunuxkeeper.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/integration/nunuxkeeper/nunuxkeeper.go b/integration/nunuxkeeper/nunuxkeeper.go
index cb340ab..76367e1 100644
--- a/integration/nunuxkeeper/nunuxkeeper.go
+++ b/integration/nunuxkeeper/nunuxkeeper.go
@@ -47,11 +47,15 @@ func (c *Client) AddEntry(link, title, content string) error {
clt := client.New(apiURL)
clt.WithCredentials("api", c.apiKey)
response, err := clt.PostJSON(doc)
+ if err != nil {
+ return fmt.Errorf("nunux-keeper: unable to send entry: %v", err)
+ }
+
if response.HasServerFailure() {
return fmt.Errorf("nunux-keeper: unable to send entry, status=%d", response.StatusCode)
}
- return err
+ return nil
}
// NewClient returns a new Nunux Keeepr client.