Browse Source

Fix "problem {x}ing post" copy-pasted error messages

Previously, they all said the same thing
Matt Baer 1 year ago
parent
commit
ca804e86e2
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      post.go

+ 5
- 5
post.go View File

@@ -129,7 +129,7 @@ func (c *Client) CreatePost(sp *PostParams) (*Post, error) {
129 129
 	} else if status == http.StatusBadRequest {
130 130
 		return nil, fmt.Errorf("Bad request: %s", env.ErrorMessage)
131 131
 	} else {
132
-		return nil, fmt.Errorf("Problem getting post: %d. %v\n", status, err)
132
+		return nil, fmt.Errorf("Problem creating post: %d. %v\n", status, err)
133 133
 	}
134 134
 }
135 135
 
@@ -154,7 +154,7 @@ func (c *Client) UpdatePost(sp *PostParams) (*Post, error) {
154 154
 		} else if status == http.StatusBadRequest {
155 155
 			return nil, fmt.Errorf("Bad request: %s", env.ErrorMessage)
156 156
 		}
157
-		return nil, fmt.Errorf("Problem getting post: %d. %v\n", status, err)
157
+		return nil, fmt.Errorf("Problem updating post: %d. %v\n", status, err)
158 158
 	}
159 159
 	return p, nil
160 160
 }
@@ -177,7 +177,7 @@ func (c *Client) DeletePost(sp *PostParams) error {
177 177
 	} else if status == http.StatusBadRequest {
178 178
 		return fmt.Errorf("Bad request: %s", env.ErrorMessage)
179 179
 	}
180
-	return fmt.Errorf("Problem getting post: %d. %v\n", status, err)
180
+	return fmt.Errorf("Problem deleting post: %d. %v\n", status, err)
181 181
 }
182 182
 
183 183
 // ClaimPosts associates anonymous posts with a user / account.
@@ -202,7 +202,7 @@ func (c *Client) ClaimPosts(sp *[]OwnedPostParams) (*[]ClaimPostResult, error) {
202 202
 	} else if status == http.StatusBadRequest {
203 203
 		return nil, fmt.Errorf("Bad request: %s", env.ErrorMessage)
204 204
 	} else {
205
-		return nil, fmt.Errorf("Problem getting post: %d. %v\n", status, err)
205
+		return nil, fmt.Errorf("Problem claiming post: %d. %v\n", status, err)
206 206
 	}
207 207
 	// TODO: does this also happen with moving posts?
208 208
 }
@@ -226,7 +226,7 @@ func (c *Client) GetUserPosts() (*[]Post, error) {
226 226
 		if c.isNotLoggedIn(status) {
227 227
 			return nil, fmt.Errorf("Not authenticated.")
228 228
 		}
229
-		return nil, fmt.Errorf("Problem getting posts: %d. %v\n", status, err)
229
+		return nil, fmt.Errorf("Problem getting user posts: %d. %v\n", status, err)
230 230
 	}
231 231
 	return p, nil
232 232
 }