From 7a1653a2e9e0802677d34f513828b33c0ef5c576 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 29 Apr 2018 17:58:09 -0700 Subject: Make sure integrations are configured before to make any HTTP requests --- integration/nunuxkeeper/nunuxkeeper.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'integration/nunuxkeeper') diff --git a/integration/nunuxkeeper/nunuxkeeper.go b/integration/nunuxkeeper/nunuxkeeper.go index 4ea5c45..cb340ab 100644 --- a/integration/nunuxkeeper/nunuxkeeper.go +++ b/integration/nunuxkeeper/nunuxkeeper.go @@ -28,6 +28,10 @@ type Client struct { // AddEntry sends an entry to Nunux Keeper. func (c *Client) AddEntry(link, title, content string) error { + if c.baseURL == "" || c.apiKey == "" { + return fmt.Errorf("nunux-keeper: missing credentials") + } + doc := &Document{ Title: title, Origin: link, -- cgit v1.2.3