subreddit: subreddit not registered message when subreddit not found
This commit is contained in:
parent
a0ff88cd43
commit
0b04bed992
|
@ -68,7 +68,7 @@ func (api *API) PubsubStartDownloadSubreddit(ctx context.Context, params PubsubS
|
||||||
subreddit, err := models.Subreddits.Query(ctx, api.db, models.SelectWhere.Subreddits.Name.EQ(params.Subreddit)).One()
|
subreddit, err := models.Subreddits.Query(ctx, api.db, models.SelectWhere.Subreddits.Name.EQ(params.Subreddit)).One()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() == "sql: no rows in result set" {
|
if err.Error() == "sql: no rows in result set" {
|
||||||
return errs.Wrapw(err, "subreddit not found", "params", params).Code(http.StatusNotFound)
|
return errs.Wrapw(err, "subreddit not registered", "params", params).Code(http.StatusNotFound)
|
||||||
}
|
}
|
||||||
return errs.Wrapw(err, "failed to verify subreddit existence", "params", params)
|
return errs.Wrapw(err, "failed to verify subreddit existence", "params", params)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
POST http://localhost:8080/api/v1/subreddits/start HTTP/1.1
|
POST http://localhost:8080/api/v1/subreddits/start HTTP/1.1
|
||||||
Host: localhost:8080
|
Host: localhost:8080
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
Content-Length: 29
|
Content-Length: 30
|
||||||
|
|
||||||
{
|
{
|
||||||
"subreddit": "awoo"
|
"subreddit": "awoo3"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue