From 34f01d7705b3986cf8f92babf0e523de8c7dd79b Mon Sep 17 00:00:00 2001
From: Benjamin Wenger <ben@elixxir.ioo>
Date: Wed, 9 Jun 2021 20:53:38 -0700
Subject: [PATCH] improved the error on bad start and stop network follower
 calls

---
 api/client.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/api/client.go b/api/client.go
index 76da7b654..d1b864acb 100644
--- a/api/client.go
+++ b/api/client.go
@@ -392,8 +392,8 @@ func (c *Client) StartNetworkFollower(timeout time.Duration) (<-chan interfaces.
 	jww.INFO.Printf("StartNetworkFollower() \n\tTransmisstionID: %s "+
 		"\n\tReceptionID: %s", u.TransmissionID, u.ReceptionID)
 
-	if c.status.get() != Stopping{
-		return nil, errors.Errorf("Cannot Start the Network Follower when it is not stopped")
+	if status := c.status.get(); status != Stopped{
+		return nil, errors.Errorf("Cannot Stop the Network Follower when it is not running, status: %s", status)
 	}
 
 
@@ -456,8 +456,8 @@ func (c *Client) StopNetworkFollower() error {
 	c.followerLock.Lock()
 	defer c.followerLock.Unlock()
 
-	if c.status.get() != Running{
-		return errors.Errorf("Cannot Stop the Network Follower when it is not running")
+	if status := c.status.get(); status != Running{
+		return errors.Errorf("Cannot Stop the Network Follower when it is not running, status: %s", status)
 	}
 
 	err := c.status.toStopping()
-- 
GitLab