diff --git a/auth.go b/auth.go index 84dc092..78ed771 100644 --- a/auth.go +++ b/auth.go @@ -39,7 +39,7 @@ func (c *Client) LogIn(username, pass string) (*AuthUser, error) { } else if status == http.StatusTooManyRequests { return nil, fmt.Errorf("Stop repeatedly trying to log in.") } - return nil, fmt.Errorf("Problem authenticating: %s. %v\n", status, err) + return nil, fmt.Errorf("Problem authenticating: %d. %v\n", status, err) } func (c *Client) isNotLoggedIn(code int) bool { diff --git a/collection.go b/collection.go index 88efe5f..47bf535 100644 --- a/collection.go +++ b/collection.go @@ -57,7 +57,7 @@ func (c *Client) CreateCollection(sp *CollectionParams) (*Collection, error) { } else if status == http.StatusPreconditionFailed { return nil, fmt.Errorf("Reached max collection quota.") } - return nil, fmt.Errorf("Problem getting post: %s. %v\n", status, err) + return nil, fmt.Errorf("Problem getting post: %d. %v\n", status, err) } // GetCollection retrieves a collection, returning the Collection and any error @@ -81,7 +81,7 @@ func (c *Client) GetCollection(alias string) (*Collection, error) { } else if status == http.StatusNotFound { return nil, fmt.Errorf("Collection not found.") } else { - return nil, fmt.Errorf("Problem getting collection: %s. %v\n", status, err) + return nil, fmt.Errorf("Problem getting collection: %d. %v\n", status, err) } return coll, nil } @@ -107,7 +107,7 @@ func (c *Client) GetCollectionPosts(alias string) (*[]Post, error) { } else if status == http.StatusNotFound { return nil, fmt.Errorf("Collection not found.") } else { - return nil, fmt.Errorf("Problem getting collection: %s. %v\n", status, err) + return nil, fmt.Errorf("Problem getting collection: %d. %v\n", status, err) } return coll.Posts, nil } diff --git a/post.go b/post.go index eaa4fae..a561452 100644 --- a/post.go +++ b/post.go @@ -86,7 +86,7 @@ func (c *Client) GetPost(id string) (*Post, error) { } else if status == http.StatusGone { return nil, fmt.Errorf("Post unpublished.") } - return nil, fmt.Errorf("Problem getting post: %s. %v\n", status, err) + return nil, fmt.Errorf("Problem getting post: %d. %v\n", status, err) } // CreatePost publishes a new post, returning a user-friendly error if one comes @@ -113,7 +113,7 @@ func (c *Client) CreatePost(sp *PostParams) (*Post, error) { } else if status == http.StatusBadRequest { return nil, fmt.Errorf("Bad request: %s", env.ErrorMessage) } else { - return nil, fmt.Errorf("Problem getting post: %s. %v\n", status, err) + return nil, fmt.Errorf("Problem getting post: %d. %v\n", status, err) } return p, nil } @@ -140,7 +140,7 @@ func (c *Client) UpdatePost(sp *PostParams) (*Post, error) { } else if status == http.StatusBadRequest { return nil, fmt.Errorf("Bad request: %s", env.ErrorMessage) } - return nil, fmt.Errorf("Problem getting post: %s. %v\n", status, err) + return nil, fmt.Errorf("Problem getting post: %d. %v\n", status, err) } // DeletePost permanently deletes a published post. See @@ -161,7 +161,7 @@ func (c *Client) DeletePost(sp *PostParams) error { } else if status == http.StatusBadRequest { return fmt.Errorf("Bad request: %s", env.ErrorMessage) } - return fmt.Errorf("Problem getting post: %s. %v\n", status, err) + return fmt.Errorf("Problem getting post: %d. %v\n", status, err) } // ClaimPosts associates anonymous posts with a user / account. @@ -186,7 +186,7 @@ func (c *Client) ClaimPosts(sp *[]OwnedPostParams) (*[]ClaimPostResult, error) { } else if status == http.StatusBadRequest { return nil, fmt.Errorf("Bad request: %s", env.ErrorMessage) } else { - return nil, fmt.Errorf("Problem getting post: %s. %v\n", status, err) + return nil, fmt.Errorf("Problem getting post: %d. %v\n", status, err) } // TODO: does this also happen with moving posts? return p, nil