From 97ba35679bc8c2ba82632e4aba42dc649784c87b Mon Sep 17 00:00:00 2001
From: jaketaylor <jake@privategrity.com>
Date: Tue, 28 Jan 2020 12:55:04 -0800
Subject: [PATCH] minor error fix

---
 api/register.go | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/api/register.go b/api/register.go
index 183e48a5f..e2352f053 100644
--- a/api/register.go
+++ b/api/register.go
@@ -1,3 +1,9 @@
+////////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 Privategrity Corporation                                   /
+//                                                                             /
+// All rights reserved.                                                        /
+////////////////////////////////////////////////////////////////////////////////
+
 package api
 
 import (
@@ -111,12 +117,10 @@ func (cl *Client) RegisterWithUDB(username string, timeout time.Duration) error
 
 		publicKeyBytes := cl.session.GetE2EDHPublicKey().Bytes()
 		err = bots.Register(valueType, username, publicKeyBytes, cl.opStatus, timeout)
-		if err == nil {
-			globals.Log.INFO.Printf("Registered with UDB!")
-		} else {
-			globals.Log.WARN.Printf("Could not register with UDB: %s", err)
+		if err != nil {
+			return errors.Errorf("Could not register with UDB: %s", err)
 		}
-
+		globals.Log.INFO.Printf("Registered with UDB!")
 	} else {
 		globals.Log.INFO.Printf("Not registering with UDB because no " +
 			"email found")
-- 
GitLab