apollo-backend/internal/reddit/errors.go

26 lines
470 B
Go
Raw Normal View History

2021-08-14 17:42:28 +00:00
package reddit
import (
"errors"
"fmt"
)
type ServerError struct {
StatusCode int
}
func (se ServerError) Error() string {
2022-03-12 17:50:05 +00:00
return fmt.Sprintf("error from reddit: %d", se.StatusCode)
2021-08-14 17:42:28 +00:00
}
var (
// ErrOauthRevoked .
ErrOauthRevoked = errors.New("oauth revoked")
2021-08-14 18:07:19 +00:00
// ErrTimeout .
ErrTimeout = errors.New("timeout")
2022-03-12 17:50:05 +00:00
// ErrRateLimited .
ErrRateLimited = errors.New("rate limited")
// ErrRequiresRedditId .
ErrRequiresRedditId = errors.New("requires reddit id")
2021-08-14 17:42:28 +00:00
)