apollo-backend/internal/reddit/errors.go
André Medeiros 8dc4ac350e omg fix watchers and subreddit things (#79)
* omg fix watchers and subreddit things

* don't send thumbnails for posts that are over 18
2022-05-26 17:54:02 -04:00

34 lines
858 B
Go

package reddit
import (
"errors"
"fmt"
)
type ServerError struct {
Body string
StatusCode int
}
func (se ServerError) Error() string {
return fmt.Sprintf("error from reddit: %d (%s)", se.StatusCode, se.Body)
}
var (
// ErrOauthRevoked .
ErrOauthRevoked = errors.New("oauth revoked")
// ErrTimeout .
ErrTimeout = errors.New("timeout")
// ErrRateLimited .
ErrRateLimited = errors.New("rate limited")
// ErrRequiresRedditId .
ErrRequiresRedditId = errors.New("requires reddit id")
// ErrInvalidBasicAuth .
ErrInvalidBasicAuth = errors.New("invalid basic auth")
// ErrSubredditIsPrivate .
ErrSubredditIsPrivate = errors.New("subreddit is private")
// ErrSubredditIsQuarantined .
ErrSubredditIsQuarantined = errors.New("subreddit is quarantined")
// ErrSubredditNotFound .
ErrSubredditNotFound = errors.New("subreddit not found")
)