mirror of
https://github.com/christianselig/apollo-backend
synced 2024-12-24 23:35:27 +00:00
more logging
This commit is contained in:
parent
05cb97d412
commit
d5affe36c1
3 changed files with 3 additions and 1 deletions
|
@ -115,6 +115,7 @@ func (a *api) createWatcherHandler(w http.ResponseWriter, r *http.Request) {
|
|||
if err != nil {
|
||||
switch err {
|
||||
case reddit.ErrSubredditIsPrivate, reddit.ErrSubredditIsQuarantined:
|
||||
err = fmt.Errorf("error watching %s: %w", cwr.Subreddit, err)
|
||||
a.errorResponse(w, r, 403, err)
|
||||
default:
|
||||
a.errorResponse(w, r, 422, err)
|
||||
|
|
|
@ -170,7 +170,7 @@ func NewSubredditResponse(val *fastjson.Value) interface{} {
|
|||
data := val.Get("data")
|
||||
sr.ID = string(data.GetStringBytes("id"))
|
||||
sr.Name = string(data.GetStringBytes("display_name"))
|
||||
sr.Quarantined = data.GetBool("quarantined")
|
||||
sr.Quarantined = data.GetBool("quarantine")
|
||||
|
||||
return sr
|
||||
}
|
||||
|
|
|
@ -136,6 +136,7 @@ func TestSubredditResponseParsing(t *testing.T) {
|
|||
assert.Equal(t, "t5", s.Kind)
|
||||
assert.Equal(t, "2vq0w", s.ID)
|
||||
assert.Equal(t, "DestinyTheGame", s.Name)
|
||||
assert.Equal(t, false, s.Quarantined)
|
||||
}
|
||||
|
||||
func TestUserResponseParsing(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue